multiple category

  • Posts: 5
  • Thank you received: 0
6 months 17 minutes ago #361158

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.1.28
-- Browser(s) name and version -- : latest Chrome

Hi there!

Is it possible to add more than one category to a menu item without the categories belonging to a parent?

So for example within a product_category there is a subcategory A and a subcategory B. Subcategory A has 1 2 3 subsub, subcategory B has 4 5 6 subsub.

And in a menu item I would like to see categories 2 and 6. Is it possible? If not, are you planning to improve this? It would be very much needed.

Thanks in advance!

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

  • Posts: 82863
  • Thank you received: 13370
  • MODERATOR
5 months 4 weeks ago #361164

Hi,

Being able to select several categories in the "main category" setting of a products listing or categories listing menu item is not something we want to add. The whole loading and display is made with the assumption that there is only one main category.
For example, you have display settings to display the name of the main category, its description, its image and its custom fields at the top of the listing. If you would have several main categories, these would be strange. Or, there is an ordering column setting. By default it is set to "ordering". This means that it uses the order of the products in the main category to display products in that order. But if you have several main categories, then you don't have an ordering for both categories. And these are just some of the reasons.

Now, there are ways to display several categories on the same page, even if they are from different branches of your category tree.

One simple solution is to use a Joomla article for the menu item. First, you create 2 modules instances of the type "HikaShop content module" via the Joomla modules manager, and you configure each to display the products of their respecting category. You don't assign them to any position, or to a position not used by your template.
Then, in a Joomla article, you use the load module content tag of Joomla in order to add these two modules:
docs.joomla.org/how_do_you_put_a_module_inside_an_article%3F
Then, you just have to create a menu item for this Joomla article.
And voilà, you have a page with the products of both categories listed.

Another solution, is to configure a hidden menu item of the type "HikaShop products listing" and configure it to display all your products. Then, configure a filter on the categories as a checkbox type.
When you access the page of the menu item, you can use the filter to get only the products of the selected categories. And you can see that the id of these selected categories in the URL.
So you can change the ids in there and put the ids of your categories 2 and 6, and you'll get a listing of all the products of either categories. You can then configure another menu item for that URL so that when the user use that menu item, it actually uses the URL of the hidden menu with your two categories preselected for the filtering.
This solution is a bit more complex to setup, and requires HikaShop Business, but you get the advantage or have a pagination support for the products listing.

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

  • Posts: 5
  • Thank you received: 0
5 months 4 weeks ago #361172

Thank you, I will try the latter option.

My problem with the joomla article is that if I use two modules per category and each category has hundreds of products, I can't display the products properly (lack of infinite scroll and page selector). Or I can't find a setting for it.

That's why it would have been a good solution if I could assign multiple categories to a menu item and get a bulk list of products.

Too bad you don't plan to improve it :)

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

  • Posts: 82863
  • Thank you received: 13370
  • MODERATOR
5 months 4 weeks ago #361174

Hi,

Yes, you won't have the pagination with the module solution, so if you have to display products from categories with a lot of products, the second option with the filtering is the only one left.
Let us know if you have a problem with it. It might require a bit of fiddling with the settings to get it right.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum