- Posts: 51
- Thank you received: 1
Show correct current category in menu w/ module
13 years 9 months ago #81001
by Dorgo
Show correct current category in menu w/ module was created by Dorgo
So I have a content menu listing categories and a content module listing latest products.
If you click a product in the latest products module, the categories menu has classes "current active" on the last category visited not the category of that product.
There are also a range of other issues with this, including two URLs for the one product, depending on which way you get to it.
/our-wines/product/3-1992-semillon-museum-release.html
/categories-listing/product/3-1992-semillon-museum-release.html
If you click a product in the latest products module, the categories menu has classes "current active" on the last category visited not the category of that product.
There are also a range of other issues with this, including two URLs for the one product, depending on which way you get to it.
/our-wines/product/3-1992-semillon-museum-release.html
/categories-listing/product/3-1992-semillon-museum-release.html
Please Log in or Create an account to join the conversation.
13 years 9 months ago #81310
by nicolas
Replied by nicolas on topic Show correct current category in menu w/ module
Hi,
Regarding your second issue, you simply have to select the same category listing menu in the "menu" option of your modules.
For the first issue, that's something we didn't think about actually. You can fix that by editing the file "listing_list" of the view "category" via the menu Display->Views and add the code:
after the code:
Regarding your second issue, you simply have to select the same category listing menu in the "menu" option of your modules.
For the first issue, that's something we didn't think about actually. You can fix that by editing the file "listing_list" of the view "category" via the menu Display->Views and add the code:
Code:
if(empty($cid)){
$database = JFactory::getDBO();
$query = "SELECT category_id FROM ".hikashop_table('product_category').' WHERE product_id='.hikashop_getCID('product_id').' OR product_parent_id='.hikashop_getCID('product_id').' ORDER BY product_category_id ASC';
$database->setQuery($query);
$cid = $database->loadResult();
}
Code:
$cid = JRequest::getInt('category_pathway',0);
The following user(s) said Thank You: Dorgo
Please Log in or Create an account to join the conversation.
13 years 9 months ago #81313
by Dorgo
Replied by Dorgo on topic Show correct current category in menu w/ module
Is this after each of the three places that
appears?
Code:
$cid = JRequest::getInt('category_pathway',0);
Please Log in or Create an account to join the conversation.
13 years 9 months ago #81627
by Xavier
Replied by Xavier on topic Show correct current category in menu w/ module
Yes, try to add the code after the three sentences.
Please Log in or Create an account to join the conversation.
13 years 9 months ago #81745
by Dorgo
Replied by Dorgo on topic Show correct current category in menu w/ module
yep, works great. Thanks
Please Log in or Create an account to join the conversation.
Time to create page: 0.180 seconds