if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.sort_order';
}
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.date_added';
}
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.sort_order';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASC';
}
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.date_added';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'DESC';
}
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.sort_order';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASC';
}
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.date_added';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'DESC';
}
$this->data['sorts'] = array();
$this->data['sorts'][] = array(
'text' => $this->language->get('text_default'),
'value' => 'p.sort_order-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url)
);
$this->data['sorts'] = array();
$this->data['sorts'][] = array(
'text' => $this->language->get('text_default'),
'value' => 'p.sort_order-DESC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.date_added&order=DESC' . $url)
);
$sort_data = array(
'pd.name',
'p.sort_order',
'special',
'rating'
);
if (in_array($sort, $sort_data)) {
if ($sort == 'pd.name') {
$sql .= " ORDER BY LCASE(" . $sort . ")";
} else {
$sql .= " ORDER BY " . $sort;
}
} else {
$sql .= " ORDER BY p.sort_order";
}
if ($order == 'DESC') {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if ($start < 0) {
$start = 0;
}
$sql .= " ORDER BY p.product_id";
$sql .= " DESC";
$sql .= " ORDER BY p.product_id";
$sql .= " DESC";
if ($start < 0) {
$start = 0;
}