Filter module on category order

  • Posts: 313
  • Thank you received: 4
  • Hikashop Business
1 week 14 hours 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: 74250
  • Thank you received: 11418
  • MODERATOR
1 week 11 hours 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: 313
  • Thank you received: 4
  • Hikashop Business
6 days 13 hours 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: 74250
  • Thank you received: 11418
  • MODERATOR
6 days 6 hours 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.067 seconds
Powered by Kunena Forum