Skip to main content

Show correct current category in menu w/ module

More
13 years 9 months ago #81001 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

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #81310 by nicolas
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:
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(); }
after the code:
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.

More
13 years 9 months ago #81313 by Dorgo
Is this after each of the three places that
Code:
$cid = JRequest::getInt('category_pathway',0);
appears?

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #81627 by Xavier
Yes, try to add the code after the three sentences.

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #81745 by Dorgo
yep, works great. Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.180 seconds
Powered by Kunena Forum