Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi all,
Storefront is huioneurope.com. There are no translations from English yet, but through Markets I have added different currencies. This created locales/subdirectories with '/en-xx'.
As suggested by the documentation I have been using the routes object to generate URLs on the homepage. I thought I had it working but then I found out that the link would work when there was a locale, but wouldn't if you were visiting the primary domain.
I then changed one of the links from the routes objects to the shop_locale object but that breaks the link when a locale is active.
The attempts I made look like this:
1.
<a href="{{ shop_locale.root_url }}/products/{{ block.settings.psco_product1.handle }}">
2.
<a href="{{ routes.root_url }}/products/{{ block.settings.psco_product2.handle }}">
Am I missing something here?
Thanks in advance for your time!
Problem solved.
So how have you solved your problem?
They may have solved it by switching to this syntax for links to collections:-
<a href="{{ products['handle'].url }}">Link</a>
I found this worked for me and wrote a blog post about it here.
You can use the same method with pages and collections if needed.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024