-- HikaShop version -- : 2.1.3
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.4.10
-- Browser(s) name and version -- : Chrome 28
Hi, I want to display a category menu on a sidebar for the product page. I'm running an antiques website and the categories of the products are like:
Textiles
- Bags
- - Subcat #XXX
- - - Product from subcat #XXX
- - Product from Bags...
- Shawls
- Ponchos
Masks
- Subcategory...
I'm building custom joomla templates for all these. I want to display a sidebar on the left for every product page. The issue is that I want this sidebar categories always from the categories at level 2. For example, if I'm on the page of the "Product from Bags", I want to display the menu as
Bags
Shawls
Ponchos
And so if I'm in "Product from Subcat #XXX". I managed to do it easily in "Bags", by using the JDocumentRenderer to render a module position as "sidebar-product-"+$product->parent_category_id (pseudocode), and generating a content module for each parent category (Textiles, Masks, and so on). The issue here is with categories deeper (like "Subcategory #XXX"), and product pages. So how can I retrieve the parent category ID at level #2 for categories as well as products?