breadcrumbs and module position

  • Posts: 43
  • Thank you received: 3
3 months 4 weeks ago #362289

-- HikaShop version -- : 5.0.2
-- Joomla version -- : 5.1.2
-- PHP version -- : 8.1.13
-- Browser(s) name and version -- : firefox

Hi,
when opening a product through the category listing, everything seems ok, I mean the breadcrumbs display a complete path to the top category and on the product's page there is no module with a module position in the product's top area but when I use the HikaShop Content Module and open a product though the module, breadcrumbs just display "Home/'Product name'" and in the top area of product page I have unwanted module with module position,
what should I do to make a product have the same breadcrumbs as when opened through the category listing?

Thanks in advance

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
3 months 4 weeks ago #362290

Hi,

The goal of the breadcrumbs is to allow the user to know where he comes from. So it's normal that by default, if he comes from a module, the breadcrumbs doesn't display the path through a category, since he actually didn't go through a category to reach the page.

Note that this means that if you have several ways to access a product page, you'll have different URLs to reach it. This will cause "duplicate content" issues with SEO.
To avoid this problem, you want to enter the main URL of each product in the "canonical URL" field of each product.
This way, it will tell search engines that regardless the URL they use to reach the product page, this is the main URL you want to be indexed for this page.

Following this, if you want your users to also always use that same URL to access the product page (so you can for example make sure that the breadcrumbs is consistent, regardless from where you access the product page), you can turn on the "force canonical URLs on listings" setting of the HikaShop configuration page so that it uses the canonical URL.

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

  • Posts: 43
  • Thank you received: 3
3 months 3 weeks ago #362328

Hi,
Thanks for your clear response,
when I link the module to a menu option, the link and breadcrumbs will be OK,
I designed two modules for Hikashop with a custom layout, but I can't add a menu option to them to fix the breadcrumbs issue, is it possible to send them and help me with them?
Thanks in advance

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
3 months 3 weeks ago #362335

Hi,

Sure. You can attach them here. If you want to send them privately, you can go through our contact form:
www.hikashop.com/support/contact-us.html
But normally, it's quite easy.
Where you generate the URL of the products in your module's code, you can just add the parameter &Itemid=xxx in the URL, where xxx is the id of the menu item you want to use.
That's basically what HikaShop does when you provide a menu item in the menu setting of the HikaShop content module.

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

  • Posts: 43
  • Thank you received: 3
3 months 3 weeks ago #362346

Hi,
Thanks again
here are both modules:
mod_hikashop_2x2productdisplayRev02:



mod_hikashop_category_products-Rev02


Thanks in advance

Attachments:

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
3 months 3 weeks ago #362348

Hi,

Well, that's exactly what I was saying in my previous message.
For example, in the file tmpl/default.php of the first module mod_hikashop_2x2productdisplayRev02-Nobreadcrumbs.zip you have the line:

<a class="hphimod4pconrca" href="<?php echo JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $item->product_id); ?>">
You want to change it to:
<a class="hphimod4pconrca" href="<?php echo JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $item->product_id.'&Itemid=xx'); ?>">
where xx is the id of the menu item you want to be used by the module.

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

  • Posts: 43
  • Thank you received: 3
3 months 3 weeks ago #362392

Perfect!
I added a filed to the admin area to let user enter the menu id and add to the link that you mentioned and now breadcrumbs work perfectly!
I use the product id to let the module access the product, what is the default address for the hikashop link when opening the product?

Thank you so much

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
3 months 3 weeks ago #362394

Hi,

It's almost this URL. We also add a parameter "name" to the URL with the alias of the product.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum