Filter module on category order

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 5 months ago #337384

-- url of the page with the problem -- : www.halaltime.eu/la-nou
-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.4.x

Hi,

How can we set the category filtering in the module on category order instead of alphabetical order like it is standard shown??

Hope you can help..
Thanks

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
2 years 5 months ago #337387

Hi,

Edit your filter and in the second category setting on the bottom right, please select your main category.

Please Log in or Create an account to join the conversation.

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 5 months ago #337423

Hi Nicolas,

This option is not going to work for us, because we have a multivendor marketplace and then the filtering will only work on 1 vendor.. but we want it to work for all different vendor categories..
Is there a way around??

Hope you can help. :)

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
2 years 4 months ago #337427

Hi,

The thing is that if you don't select a category there, then it will display all the categories in the filter, but in that case, it's logically impossible to use the "order" of the categories since the order of a category is set based on ordering of the subcategories of its parent category, and thus it won't work with categories having different parents since you'll have categories with the same ordering for different parent categories.
That's why the system falls back to ordering the categories by name.
The solution would be to create a custom category field, where you could enter the ordering for each category for that filtering.
Then, you would have to change the line:
$orderby = 'a.category_name ASC';
to:
$orderby = 'a.xxx ASC';
(where xxx is the column name of that custom field) in the file administrator/components/com_hikashop/classes/filter.php
Note however that this is a modification to a core file of HikaShop and thus you'll loose the modification when you update your Hikashop, and you'll have to reapply it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum