Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Решено] Вывод товаров со скидкой первыми в категории


 Share

Recommended Posts

Подскажите как сделать чтобы в категориях акционные товары выводились в первую очередь, товаров много, и править всем sort-order довольно затруднительно.

Edited by Makuronai
Link to comment
Share on other sites


Попробуйте в model - catalog - product найти строку $sql .= " ORDER BY p.sort_order"; их там вероятно 2. Вас интересует первая найденная. Замените ее на $sql .= " ORDER BY ps.price";

Проверить сейчас нет возможности, но по идее это выведет сначала товары с ценами у которых есть акционная цена в порядке возрастания т.к. далее идет ASC.

Link to comment
Share on other sites

  • 2 weeks later...

В общем простейшим решением оказалось заменить в catalog/model/catalog/product.php строку:
 

$sql .= " ORDER BY " . $data['sort'];

на двойную сортировку, по наличию акции и номеру
 

$sql .= " ORDER BY special DESC, p.sort_order ";

 

  • +1 2
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.