News:

Looking for documentation? Take a look on our wiki

Main Menu

How to display products of the parent category

Started by visitmontaione, November 23, 2022, 13:05:53 PM

Previous topic - Next topic

visitmontaione

Hello everybody, let's say I have this product: "Vino della casa"

This is in category: "Red wines".

VM Category: "Red wines" is under parent category "Wines".

In Joomla menu "Wines" is linked to VM category "Wines", and "Red Wines" is linked to VM category "Red Wines". That's ok.

The question is: how can I display "Red wines" products into the page "Wines"?

You will answer: because the wine "Vino della casa" has only category "Red wines" AND NOT "Wines".

So, I ask again is there a trick to do display display "Red wines" into the page "Wines"?

Because "Red wines" is category son of "Wines"...

Jörgen

Afaik categories are not linked to each other, they just have a hierarchical relationsship. If You want to display Red Wines under Wines the product must belong to both categories. Either by inheritance from the parent product or by itself. Categories do not inherit categories, child products are populated with data from the parent product if the field in the child is empty. If not empty no inheritance. Adding red wines for a child product that has aparent belonging to Wines will only give red wines as category.  Adding Wines + Red wines to child product gives desired result.

Jörgen @ Kreativ category
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

Yes, what you want todo is only possible for the top category with id = 0. But the solution is simple, just use the mass xref for categories and add your products to wine also.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

visitmontaione

Thank you Milbo and Jörgen for your replies.

Quote from: Milbo on December 05, 2022, 19:15:57 PM
But the solution is simple, just use the mass xref for categories and add your products to wine also.

I have not understood how to do this. Can you please explain me better?

Do you mean I have to assign category "Wine" to the products that are also under "red wines" and "white wines"?

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

Add all products to main category. It's easy to do using VM Be Pro for eg.
But you can use the Mass associate category in the virtuemart products view

peckversed

I've used Mass associate and it's pretty scientifically designed.
Kristopher Stevenson