Conditional module display in product detail page of a specific category

Started by valekichia, April 12, 2018, 15:05:42 PM

Previous topic - Next topic

valekichia

Hello,

is there a way to display a module only in the product detail page of the products belonging to a specific subcategory and its sub-subcategories?

I have this type of category hierarchy:

- MAIN CATEGORY
--- Subcat A
-------- Sub-subcat 1
-------- Sub-subcat 2
-------- Sub-subcat 3
--- Subcat A
-------- Sub-subcat 1
-------- Sub-subcat 2
-------- Sub-subcat 3

I need to display a module only onn product detail page of products belonging to a sub-subcat of Subcat A.
Each product is assighed both to SubcatA and a Sub-subcat.

Is there a way to achieve this?

Thank you!

---
Joomla 3.8.6
Virtuemart 3.2.14

jenkinhill

You can use category specific template overrides. I'd edit & create an override components/com_virtuemart/views/productdetails/tmpl/default.php to include a placeholder for your module. Depends where exactly you want to show it - and if you already use template overrides.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

valekichia

Why didn't I think about it! (facepalm)
Quick and easy!
Thank you jenkinhill! You saved my day!