Sort New to Old products in OpenCart
One problem that I have explored is that while OpenCart, OpenCart default rating, the latest product to the bottom, if the list of products we have 2 pages, it’s clear to see the list of customers will can not see new products that find the former.
Struggling to modify many places and many times in the code, finally found a way to sort, it is not difficult not to notice, and are not fluent, can not figure out.
Today admin guide the you order products islands, new arrangements up on the, former downhill.: Oni (73):
On in category.php the path of the following: catalog / controller / product / category.php. Opened it to find this:
[Codesyntax lang = “php”]
request->get[‘sort’])) {“>if (isset ($ this-> request-> get [‘sort’])) {
request->get[‘sort’];”>$ Sort = $ this-> request-> get [‘sort’];
} Else {
$ Sort = ‘p.sort_order’;
}
[/ Codesyntax]
Instead of this:
[Codesyntax lang = “php”]
request->get[‘sort’])) {“>if (isset ($ this-> request-> get [‘sort’])) {
request->get[‘sort’];”>$ Sort = $ this-> request-> get [‘sort’];
} Else {
$ Sort = ‘p.date_added’;
}
[/ Codesyntax]
Next find the following code:
[Codesyntax lang = “php”]
request->get[‘order’])) {“>if (isset ($ this-> request-> get [‘order’])) {
request->get[‘order’];”>$ Order = $ this-> request-> get [‘order’];
} Else {
$ Order = ‘ASC’;
}
[/ Codesyntax]
replaced with the following code:
[Codesyntax lang = “php”]
request->get[‘order’])) {“>if (isset ($ this-> request-> get [‘order’])) {
request->get[‘order’];”>$ Order = $ this-> request-> get [‘order’];
} Else {
$ Order = ‘DESC’;
}
[/ Codesyntax]
this is done, in OpenCart there are many shortcomings, if you do not notice you do not see the problem URL is a relatively intractable problem with a lot of people, the URL for the product, the URL for the ie, the URL for the tag clous … Optimization is difficult, if you do not know you will take quite some time, the following article I will introduce the other part gradually optimized for OpenCart.