如何将opencart商店中的默认排序顺序更改为stock_status_id减少?

时间:2016-12-12 05:35:00

标签: sorting opencart product

我做了这些:

catalog/controller/product/category.php
我改变了:

if (isset($this->request->get['sort'])) {
            $sort = $this->request->get['sort'];
        } else {
            $sort = 'p.stock_status_id';
        }

默认情况下,当我刷新页面时,当我选择默认选项时,没有任何操作可用,我看到此代码?sort=p.stock_status_id&order=DESC&limit=100但尚未按stock_status_id排序!

1 个答案:

答案 0 :(得分:-1)

打开此文件:

catalog/controller/product/category.php

查找

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.quantity';
}

if (isset($this->request->get['order'])) {
    $order = $this->request->get['order'];
} else {
    $order = 'DESC';
}