Breadcrumb content question

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
7 months 3 weeks ago #360475

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 5.0.3
-- PHP version -- : 8.2

Hi,

I have a breadcrumb display and hope you can help me.

For products, the breadcrumbs is using the name field of the product page. Do you know if it would be possible (and if yes how) to use the alias instead of the name?

Thanks in advance!

Sandra

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

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
7 months 3 weeks ago #360483

Hi,

I suppose you can use Joomla's Pathway API to modify the breadcrumb on the fly in a view override of the product page layout.
For example, you can edit product / show_default via the menu Display>Views of HikaShop and add this at the beginning:

<?php 
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$names = $pathway->getPathwayNames();
$pathway->setItemName(count($names)-1, $this->element->product_alias);
?>
Based on:
www.phoca.cz/apis/1-joomla/573-pathway
Note that this code has not been tested. I've written this on the fly so it might not work, but it should be something close to this.

Last edit: 7 months 3 weeks ago by nicolas.
The following user(s) said Thank You: Sandra74

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

  • Posts: 159
  • Thank you received: 12
  • Hikashop Business
7 months 3 weeks ago #360488

Hi Nicolas,

I have just 2 words: You rock!!!

It works like a charm.

Thank you so much.

Sandra

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

Time to create page: 0.054 seconds
Powered by Kunena Forum