Post by bralon » Tue Apr 18, 2017 5:21 pm

Hello,

I just wondered if it was possible to sort the categories in alphabetical order on all the site without having to use the classification in the administration?

What to change in code queries,

thank you in advance

Newbie

Posts

Joined
Tue Apr 18, 2017 5:19 pm

Post by rjcalifornia » Fri Apr 21, 2017 12:07 pm

Open file:
category.php in catalog/controller/product/category.php
Then change this:

Code: Select all

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

Code: Select all

		if (isset($this->request->get['sort'])) {
			$sort = $this->request->get['sort'];
		} else {
			$sort = 'pd.name';
		}
Let me know if that works for you.

Image


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by cepcemuh » Tue Nov 13, 2018 8:49 pm

Hi guys... I just was wondering if anyone can help me to sort the categories not by name but by date... Will be very happy if someone can help me. Thank you.

New member

Posts

Joined
Sat Jan 21, 2017 5:15 pm

Post by thekrotek » Tue Nov 13, 2018 10:55 pm

cepcemuh wrote:
Tue Nov 13, 2018 8:49 pm
Hi guys... I just was wondering if anyone can help me to sort the categories not by name but by date... Will be very happy if someone can help me. Thank you.
See example above, replace "pd.name" with "p.date_added".

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member
Online

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by cepcemuh » Wed Nov 14, 2018 3:24 am

Tried... but it doesn't work :( Any other ideas? Tried to refresh the modifications, cleared the cache... nothing...

New member

Posts

Joined
Sat Jan 21, 2017 5:15 pm

Post by thekrotek » Wed Nov 14, 2018 5:54 am

cepcemuh wrote:
Wed Nov 14, 2018 3:24 am
Tried... but it doesn't work :( Any other ideas?
Ask for commercial support.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member
Online

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 16 guests