[Skip to main content](#vessel-content)

#   Get the Itemid

##

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 6 months ago [\#15169](#15169) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  *[Get the Itemid](/forum/4-how-to/15169-get-the-itemid#15169 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")* was created by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")*

Hi there,

I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb

Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name

I don't want 'product category' to appear. We want the breadcrumb to be:

Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name

To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

15 years 6 months ago -  15 years 6 months ago [\#15178](#15178) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#15178 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hi,

That's correct.
There is no function for that. What we do is that we usually have an option with the user can select the menu to use so that we can properly fill the Itemid parameter of the URLs. You can see that in the modules's hikashop options and the search plugin.
If you want to get automatically the Itemid based on a category you need to have something like that (not tested): Code:

function getItemidFromCategory($category_id){ $config =&amp; hikashop::config(); foreach($config-&gt;values as $key =&gt; $value){ if(preg_match('#menu_([0-9]+)#',$key,$match)){ if(is_string($value-&gt;config_value)) $value-&gt;config_value = unserialize(base64_decode($value-&gt;config_value)); if($value-&gt;config_value['selectparentlisting'] == $category_id ){ return $match[1]; } } } return false; }

Last edit: 15 years 6 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 6 months ago -  15 years 5 months ago [\#15193](#15193) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#15193 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hello Nicolas, thanks for the big pointer. Here is a working version.
Code:

function getItemidFromCategory($category_id) { $config = &amp; hikashop::config(); $values = $config-&gt;values; foreach ($values as $key =&gt; $value) { if (preg_match('#menu_([0-9]+)#', $key, $match) &amp;&amp; is_string($value-&gt;config_value)) { $options = unserialize(base64_decode($value-&gt;config_value)); if ($options['selectparentlisting'] == $category_id) { return $match[1]; } } } return false; }

However I would like to add. The Itemid parameter of the URLs that you can add in the product search plugin only works if all product categories share a common parent menu item. What do you do if you you don't follow this structure?

Last edit: 15 years 5 months ago by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

15 years 6 months ago [\#15196](#15196) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#15196 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

I've updated the code in my post after your modifications. It should be better.

Concerning the search plugin that is indeed the case. You can always create a specific menu which is not displayed on your template with the main "product category" category as parent category and use that menu in the plugin

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 5 months ago [\#15305](#15305) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#15305 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hi Nicolas, okay we took you improvements and we have added them tothe hikashop_products.php search file. So we now have perfect breadcrumbs from search results! Yay! We have worked on version 1.4.9

In line 132 we modified the line to:
Code:

$select = ' a.product_id AS id, a.product_name AS title, a.product_created AS created , a.product_description AS text, "'.$new_page.'" AS browsernav, b.category_id as category_id';

Then after line 187 - foreach ( $rows as $k =&gt; $row ) {
Code:

if(empty($item_id)){ $Itemid = $this-&gt;getItemidFromCategory($rows[$k]-&gt;category_id); if(!empty($Itemid)){ $item_id='&amp;Itemid='.$Itemid; if($this-&gt;params-&gt;get('full_path',1)){ $menuClass = dacshop::get('class.menus'); $menuData = $menuClass-&gt;get($item_id); if(!empty($menuData-&gt;dacshop_params['selectparentlisting'])){ $parent = '&amp;category_pathway='.(int)$menuData-&gt;dacshop_params['selectparentlisting']; } } } }

we put the function getItemidFromCategory($category_id) at end. Comments welcome

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

15 years 5 months ago [\#15311](#15311) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#15311 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

We'll integrate that for next release.

The , b.category_id as category_id code should not be added in the $select variable but directly in the query:
$query = ' SELECT '.$select.', b.category_id as category_id FROM '.hikashop::table('product') . ' AS a '.$leftjoin.' WHERE '.implode(' AND ',$filters).' ORDER BY '.$order;

Otherwise, it will break the query:
$query = ' SELECT DISTINCT '.$select.' FROM '.hikashop::table('jf_content',false) . ' AS b LEFT JOIN '.hikashop::table('product').' AS a ON b.reference_id=a.product_id WHERE '.implode(' AND ',$filters2).' ORDER BY '.$order;
when joomfish is installed.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 1 month ago -  15 years 1 month ago [\#25658](#25658) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#25658 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

I see this solutaion for obtaining the itemid has been removed in version 1.5.3. This now results in blank pages when the user searches for a category and clicks to display the category. In the category search plugin we have not set the Itemid because our menu structure is:

Home
Category1 &gt; Subcategory1 &gt; AnotherSubcategory1
Category2 &gt; Subcategory2 &gt; AnotherSubcategory2
Category3 &gt; Subcategory3 &gt; AnotherSubcategory3
Category4 &gt; Subcategory4 &gt; AnotherSubcategory4

So you can we don't have single itemid that satisfies the setting for each view. The solution in these posts worked well. I presume when the the manufacture option was added it was removed for some reason. (edit - sorry, getting confused. This was implemented for the product search - now I am going see if something similar can be implemented to get the itemid if the itemid is not set in the category plugin.)

Last edit: 15 years 1 month ago by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

15 years 1 month ago [\#25665](#25665) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#25665 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Indeed. That was never implemented for the categories search plugin.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile") Topic Author
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

15 years 1 month ago [\#25668](#25668) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#25668 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Okay. I seem to have a solution that is working for the categories search and have also resolved a bug with the product search. I am sending you them by email.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gulp](/forum/user/31237-gulp "View gulp's Profile")**
- [![gulp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31237-gulp "View gulp's Profile")
- [ Offline](/forum/user/31237-gulp)

Less More

- Posts: 99
- Thank you received: 2
-
-

12 years 4 months ago [\#158052](#158052) by [gulp](/forum/user/31237-gulp "View gulp's Profile")  Replied by *[gulp](/forum/user/31237-gulp "View gulp's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#158052 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hello,
does it comes to a solution to find the correct menu-itemid for each product listed ?
Is there a function that could be used to retrieve it in Content Display module to set the itemid in the $link variable ?

I suppose it should be updated in the code of listing_img_title.php as an override ...
... an option in module that say "auto get product item-id if exists !" would also be a great way !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 4 months ago [\#158103](#158103) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#158103 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hi,

It is what we done using the "product canonical url" and the new option in HikaShop 1.4.1

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gulp](/forum/user/31237-gulp "View gulp's Profile")**
- [![gulp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31237-gulp "View gulp's Profile")
- [ Offline](/forum/user/31237-gulp)

Less More

- Posts: 99
- Thank you received: 2
-
-

12 years 4 months ago [\#158540](#158540) by [gulp](/forum/user/31237-gulp "View gulp's Profile")  Replied by *[gulp](/forum/user/31237-gulp "View gulp's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#158540 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hello,
I've set "Force canonical URLs on listings = Use canonical URL and generate it if missing"
but the Itemid is always still the same for each product in list.
Looking at the code of listing_img_title.php doesn't seems to try to get the menu item anywhere,
it couldn't be easy to find, not just with a simple query, because I suppose we have to search in all menu items for a param like {product_id: ... }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gulp](/forum/user/31237-gulp "View gulp's Profile")**
- [![gulp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31237-gulp "View gulp's Profile")
- [ Offline](/forum/user/31237-gulp)

Less More

- Posts: 99
- Thank you received: 2
-
-

12 years 4 months ago [\#158579](#158579) by [gulp](/forum/user/31237-gulp "View gulp's Profile")  Replied by *[gulp](/forum/user/31237-gulp "View gulp's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#158579 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

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**Code:

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

and updated the $link variable in **listing\_img\_title.php** like: Code:

$itemid = (int)$this-&gt;prod_arr[$this-&gt;row-&gt;product_id]; $link = hikashop_completeLink('product&amp;task=show&amp;cid='.$this-&gt;row-&gt;product_id.'&amp;name='.$this-&gt;row-&gt;alias."&amp;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lionel75](/forum/user/11856-lionel75 "View lionel75's Profile")**
- [![lionel75's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11856-lionel75 "View lionel75's Profile")
- [ Offline](/forum/user/11856-lionel75)

Less More

- Posts: 846
- Thank you received: 92
-
-

11 years 5 months ago [\#200532](#200532) by [lionel75](/forum/user/11856-lionel75 "View lionel75's Profile")  Replied by *[lionel75](/forum/user/11856-lionel75 "View lionel75's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#200532 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hi
can i have more information about
- the itemid : id of the menu ( module) or one of the id of a menu ( one of the list title of the menu )
- the relation beetween itemid and Canonical URL ?

thank's

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 5 months ago [\#200538](#200538) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#200538 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

Hi,

- An Itemid is an Itemid... It's a Joomla menu.
- There is no relation between them.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [lionel75](/forum/user/11856-lionel75 "View lionel75's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gulp](/forum/user/31237-gulp "View gulp's Profile")**
- [![gulp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31237-gulp "View gulp's Profile")
- [ Offline](/forum/user/31237-gulp)

Less More

- Posts: 99
- Thank you received: 2
-
-

11 years 5 months ago [\#200699](#200699) by [gulp](/forum/user/31237-gulp "View gulp's Profile")  Replied by *[gulp](/forum/user/31237-gulp "View gulp's Profile")* on topic *[Re: Get the Itemid](/forum/4-how-to/15169-get-the-itemid#200699 "Hi there,  I am building a product scroller for hikashop. Everything is working correctly except the breadcrumb when we view the product. At the moment the scroller works with only category at a time. Currently when you click on the link to view a product we get the following breadcrumb  Home &gt; product category &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  I don't want 'product category' to appear. We want the breadcrumb to be:  Home &gt; Category A &gt; Category B &gt; Category C &gt; Product Name  To do so we need the Itemid value for Category A in the URL. Correct? Does Hikashop already have a function that allows you to obtain this value? Thanks")*

I think he's asking what kind of id is the itemid we're talking about,
then it is the id of each menu item useful when you need to enable a module for a certain page by the settings of the module itself.
If this element isn't present in the url the module will not be loaded.

The following user(s) said Thank You: [lionel75](/forum/user/11856-lionel75 "View lionel75's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1MTY5LWdldC10aGUtaXRlbWlkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.496 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
