Jump to content
Sign in to follow this  
mamind93

[Решено] Сортировка по дате для OC 2

Recommended Posts

Добрый день, перечитал темки сортировки для 1.5, все перепробовал, но так ничего и не вышло. Скажите, как сделать сортировку по умолчанию - по дате добавления товаров. OC 2.1.

Share this post


Link to post
Share on other sites

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

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

Будет выводить самые новые товары в категории.

  • +1 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.