Setting Joomla modules for products with menu item

  • Posts: 99
  • Thank you received: 2
11 years 2 months ago #157083

-- HikaShop version -- : 2.3.1 Essential
-- Joomla version -- : 3.3

Hi,
how is it possible to set Joomla modules in pages that comes from a category/products listing ?
It seems that also if I create a menu item pointing directly to a product and set a joomla module for that menu item, if there is also a category list for that product, the product page will get the category modules instead of those modules set for the product menu item ?

I think this is also connected to a strange behaviour for breadcrumbs that I'm asking about in this post .
This is because if I substitute the correct menu item param (&Itemid=) everything works fine ... :dry: :huh:

Thank you for any suggestion !

Last edit: 11 years 2 months ago by gulp.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #157306

Hi,

To have different modules in a product page when coming from a listing, you will need the extension "advanced module manager".

In the options of the category module displayed on the product page, you can potentially select another "menu" option in order to have a menu displaying the desired modules.

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

  • Posts: 99
  • Thank you received: 2
11 years 2 months ago #157322

Thank you, I've never used this extension and I don't know how it will impact over the performance of the site (I'm trying to keep the number of the extensions installed very low...).
Do you think it is huge or light ?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #157376

Hi,

I think it is light. What I suggest is to see in how many time a page is loaded currently thanks to your browser console, then install the extension and see the variation of the page load time.

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

  • Posts: 99
  • Thank you received: 2
11 years 2 months ago #157512

Ok, I'll try this way !!
Thanx !!

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

  • Posts: 99
  • Thank you received: 2
11 years 2 months ago #158035

Hello again,
for a Content Display module how to make it works good ?
If the module is showing a list of products inside a category and I've to set a menu item inside the menu,
how to make a specific module to appear inside of the page of the specific product clicked by the content display module ?

Probably the best question is: how to make the Content Display module to make each product point correctly to his page and corresponding menu item ?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 2 months ago #158088

Hello,

how to make a specific module to appear inside of the page of the specific product clicked by the content display module ?

Using the Advanced module manager will probably do the job.

Probably the best question is: how to make the Content Display module to make each product point correctly to his page and corresponding menu item ?

To set the good menu item when you click on a product of your product listing content module, you'll just have to set the good menu through the "menu" option of your product listing content module.

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

  • Posts: 99
  • Thank you received: 2
11 years 2 months ago #158537

Like this it doesn't works:
- by using Advanced Module Manager I could set in which page/url a module will appear, but not to which pages each Content Display element will point to
- this settings is one-against-many, the module lists many items that should point to different pages, I suppose this should be strictly related to this post

Thank you

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

  • Posts: 99
  • Thank you received: 2
11 years 2 months ago #158800

I've made a fast update of the code to try to retrieve the menu item id.
I've updated two files in components/com_hikashop/views/product/tmpl/
(I think that once these becomes working these could be put as overrides in template joomla dir)

Add this code to listing_div.php

$db = JFactory::getDbo();
	$query = $db->getQuery(true);
	$query->select('*');
	$query->from($db->quoteName('#__menu'));
	$query->where($db->quoteName('link')." = ".$db->quote('index.php?option=com_hikashop&view=product&layout=show'));	 
	$db->setQuery($query);
	$result_menu = $db->loadAssocList();	
	$prod_arr = array();
	foreach ($result_menu as $res_item)
	{
		$prod_param = json_decode($res_item['params']);
		$prod_id = $prod_param->product_id;
		$prod_arr[$prod_id] = $res_item['id'];
	}
	//print_r($prod_arr);
	$this->prod_arr = $prod_arr;

and updated the $link variable in listing_img_title.php like:
	$itemid = (int)$this->prod_arr[$this->row->product_id];
	$link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias."&Itemid=".$itemid);

What do you think about it ?
I know it's not really a good coding and not so good for performance, because it retrieves many menu items without filtering over the category on the query.

Thank you for any suggestion !

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

  • Posts: 99
  • Thank you received: 2
10 years 9 months ago #177146

Hello,
is there a way to make this update stable, avoiding to be overwritten each time you release an official update ?

Last edit: 10 years 9 months ago by gulp.

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

  • Posts: 3
  • Thank you received: 0
10 years 9 months ago #177170

Yes, this could be useful !!

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

  • Posts: 84155
  • Thank you received: 13652
  • MODERATOR
10 years 9 months ago #177203

Hi,

Instead of editing directly the files in the folders, edit them for the "product" view for your template via the menu Display>Views of HikaShop and you won't loose the changes when you update HikaShop.

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

  • Posts: 99
  • Thank you received: 2
10 years 9 months ago #177333

Great, I didn't know this feature yet !

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

Time to create page: 0.105 seconds
Powered by Kunena Forum