Multilingual alias/breadcrumb

  • Posts: 174
  • Thank you received: 15
  • Hikashop Business
2 days 5 hours ago #369268

-- url of the page with the problem -- : rolex.jewelrygoldfinger.com/fr/accessoir...chette-cannele-a1039
-- HikaShop version -- : 6.1.0
-- Joomla version -- : 5.4
-- PHP version -- : 8.2

Hello,

I would need your help with an alias/breadcrumb question.

In one section of the site, I need the breadcrumb to be different from the other sections.

For these products, for example rolex.jewelrygoldfinger.com/fr/accessoir...chette-cannele-a1039
- In English, it should be (and it is): Fluted cufflinks A1039
- In French, it should be: Boutons de manchette Cannelé A1039

It's ok for English but not for French.

Any idea what I should do?

Thanks in advance and have a great day,

Sandra

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

  • Posts: 84654
  • Thank you received: 13768
  • MODERATOR
1 day 23 hours ago #369274

Hi,

I don't see why that would be the case.
In the file components/com_hikashop/views/product/view.html.php you have the line:

$pathway->addItem(strip_tags($product_name), hikashop_completeLink('product&task=show&cid='.(int)$element->product_id.'&name='.$element->alias.$category_pathway.$url_itemid));
which adds the product name to the breadcrumbs pathway.
And $product_name is defined before with the line:
$product_name = hikashop_translate($element->product_name);
So the product name in the breadcrumbs module's pathway should be the translated text.
And I can see that the product name displayed on the page is the translated text.
I guess it would require some debugging on your website near these lines of code to better understand what's going on.

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

  • Posts: 174
  • Thank you received: 15
  • Hikashop Business
1 day 9 hours ago #369289

Hi Nicolas,

Thanks for your answer.

We modified the breadcrumb so that it's using the alias instead of the product name ( www.hikashop.com/forum/product-category-...ontent-question.html ). Could it be because of this?

Sandra

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

  • Posts: 84654
  • Thank you received: 13768
  • MODERATOR
22 hours 21 minutes ago #369295

Hi,

Ah yes ! That would indeed be the root of the problem.
Instead of:

$pathway->setItemName(count($names)-1, $this->element->product_alias);
You should use:
$pathway->setItemName(count($names)-1, hikashop_translate($this->element->product_alias));
Then, the alias would be translated in the breadcrumbs.

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

  • Posts: 174
  • Thank you received: 15
  • Hikashop Business
10 hours 25 minutes ago #369315

Thank you so much Nicolas. It works like a charm

Sandra

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

Time to create page: 0.061 seconds
Powered by Kunena Forum