Sắp xếp sản phẩm theo thời gian
Đầu tiên vào : admin/controller/catalog/product.php
Tìm ( ctrl +F)
if (isset($this->request->get['sort'])) {Thay thành code sau ( Replace with following code):
$sort = $this->request->get['sort'];
} else {
$sort = 'pd.name';
}
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';
}
Tiếp theo tìm đến đường dẫn sau:
In the file admin/model/catalog/product.php add the red marked code
$sort_data = array(
'pd.name',
'p.model',
'p.price',
'p.quantity',
'p.status',
'p.sort_order',
'p.date_added' //thêm dòng này vào (add this column name)
);
0 comments:
Post a Comment