VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: valekichia on April 12, 2018, 15:05:42 PM

Title: Conditional module display in product detail page of a specific category
Post by: valekichia on April 12, 2018, 15:05:42 PM
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
Title: Re: Conditional module display in product detail page of a specific category
Post by: jenkinhill on April 12, 2018, 18:25:09 PM
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.
Title: Re: Conditional module display in product detail page of a specific category
Post by: valekichia on April 13, 2018, 10:10:42 AM
Why didn't I think about it! (facepalm)
Quick and easy!
Thank you jenkinhill! You saved my day!