All things Shopify and commerce
Hello everyone!!
I need again your help 🙂
If the user goes from the collection page to the product page I have this URL structure: https:myshop.com/collections/collections_name/products/products_name
I need to change this URL to this: https:myshop.com/products/products_name
How can I do it?? Can you help me, please??
Thank you so much
Hi
This is Victor from PageFly - Shopify Page Builder App
It will require to modify the collection code in your liquid file
Step 1: Online Stores > Themes > More Actions > Edit code
Step 2: Seach for collection => Select each file and do the search in file for
{{ product.url | within: collection }}
If you see it, replace the whole line above with
{{ product.url }}
It depends on your theme you are using, but please go search around these files
Hope this can help you solve the issue
Best regards,
Victor | PageFly
Hi @PageFly-Victor ,
thank you so much for your reply.
I checking on template--product.liquid and template--product.liquid but I cannot found this {{ product.url | within: collection }}
Can you said me on which section I need to do this change?
Thank you so much again!
I found that:
<article class="indiv-product">
<a href="{{ product.url | within: collection }}" title="{% if product %}{{product.title}}{% else %}{{ 'general.onboarding.product_title' | t }}{% endif %}">
{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'product-' | append: current | placeholder_svg_tag: 'icon--placeholder' }}
</a>
<div class="hp-title">
<a href="{{ product.url | within: collection }}">
<span class="indiv-product-title-text">{{ 'general.onboarding.product_title' | t }}</span>
<span class="money money-styling">
{{ 1999 | money }}
</span>
</a>
</div>
</article>
But if I remove "| within : collection" the URL doen't change...
Hi @PageFly-Victor ,
please check this page; https://lookeronline.com/collections/oakley-sunglasses/products/oakley-oo9013-24-306
I'd like the URL become the same of canonical.
It's possible to do it?
Thank you so much!
@PageFly-Victor If you can, I can share the code to allow you like a collaborator.
@Niccolò8
Yes thank you, please send me the collab code for access.
That would be great
Hey @PageFly-Victor , what about in PageFly template files? Unfortunately, PageFly template files are autogenerated and removing "within: collection" tag from them will be overridden when a page published again.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025