Author Topic: Conditional module display in product detail page of a specific category  (Read 78 times)

valekichia

  • Beginner
  • *
  • Posts: 28
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26745
  • Always on vacation
    • Jenkin Hill Internet
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM3.2.14.9808 on Joomla 3.8.6 PHP 7.0.29

Testing VM3.2.14.9808 on J3.8.6

valekichia

  • Beginner
  • *
  • Posts: 28
Why didn't I think about it! (facepalm)
Quick and easy!
Thank you jenkinhill! You saved my day!