VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: EIF on March 03, 2022, 11:16:29 AM

Title: Display products from all subcategories in parent category (VM 3.8.8)
Post by: EIF on March 03, 2022, 11:16:29 AM
At the moment I am working on a (Dutch) webshop based on Virtuemart 3.8.8, Joomla 3.10.6 and PHP 7.4.

What I want is to display products form all subcategories in the parent category.

I have several productcategories, with a maximum depth level of 3. So a productcategory have subcategories and those subcategories have their own subcategories. To illustrate this, I have taken a screenshot of the webshop.

(https://ecowereld.shop/images/screenshot/productcategories.jpg)

The main (parent) category is for example "Woon & Leven", marked with number 1.
That productcategory have several subcategories, for example "Woonaccessoires", marked with number 2.
That subcategory have several own subcategories, for example "Woondecoratie", marked with number 3.

I have configured the VM config template setting (and also tried the menu settings for the categories) in such way that the parent category must display the products of the subcategories.

The result of this, is that subcategory (level) 2 now displays all the products of each underlying subcategory (level) 3. So that is great, that is what I want.

But... I like to have the same behavior on the parent category, number 1. When I click on "Woon & leven", which is the parent category 1, I like to display all the products of the underlying subcategories. Actually the products which are in productcategory 3. So productcategory 2 is displaying products of category 3. And category 1 is displaying the products of category 2 (which are in fact the products of category 3, the deepest category level),

The strange thing is that the productcategory 1, the parent category, only displays 4 products now. There are no products in that category, so it must be some products from the sub(sub)categories. But why only 4? There must be hundreds of products in the parent category.

You can see this all on the live webshop https://ecowereld.shop (https://ecowereld.shop).


Title: Re: Display products from all subcategories in parent category (VM 3.8.8)
Post by: Studio 42 on March 04, 2022, 11:10:26 AM
You have a setting to show all product in subcategories  in the Virtuemart config
Do you use it ?
Title: Re: Display products from all subcategories in parent category (VM 3.8.8)
Post by: EIF on March 08, 2022, 09:11:20 AM
You mean this setting?

(https://ecowereld.shop/images/screenshot/settings.jpg)

I have changed "Show Childeren category" from Yes to No to Yes again. Somehow that fixed the problem.
Title: Re: Display products from all subcategories in parent category (VM 3.8.8)
Post by: GJC Web Design on March 08, 2022, 10:55:32 AM
Yes ... the config must be saved once to write it ..  perhaps the config had never been written and was just using the defaults