Liquid, JavaScript, themes, sales channels
Hi everyone! I´m having this problem, in collections pages, the images from the products grid are pointing to non canonical URLs. With this image is clear:
I´ve changed the <a href from the product title to {{ product.url}} and work fine, and I made the same change in the <a href in the image but it didn´t work. The template is this one: product-get-images.liquid.
Anyone know how to solve this? I´m having problems with SEO because of the poor crawling from Googlebot.
Thanks!
Hi @jaimesd,
Please send the site's link and code of product-get-images.liquid file. I will check it.
Hi, thanks for the answer. I send you the code of product-get-images.liquid
{%- if settings.product_format_pjpg -%}
{%- assign image_format = 'pjpg' -%}
{%- else -%}
{%- assign image_format = null -%}
{%- endif -%}
{%- if settings.product_collection_image_size != 'auto' -%}
{%- assign stretch_size = settings.product_collection_image_size -%}
{%- assign height_procent = settings.product_collection_image_height_percent -%}
{%- endif -%}
<a href="{{ url }}" class="d-block cursor-default" data-js-product-image>
{%- capture image_id -%} data-image-id="{{ image.id }}"{%- endcapture -%}
{% render 'rimage' with image: image size: image_size format: image_format height_procent: height_procent stretch_size: stretch_size alt: title attr: image_id %}
</a>
The web is https:// thelofbox.com/
Hi @jaimesd ,
Please change:
<a href="{{ url }}" class="d-block cursor-default" data-js-product-image>
=>
<a href="{{ product.url }}" class="d-block cursor-default" data-js-product-image>
It will work fine.
If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck.
Hi @LitCommerce I´ve already tried that but unfortunately, doesn´t work, I don´t know why... With that change, the image links to the collection URL, not the product. Also I´ve tried with {{canonical.url}} but nothing
Hi @jaimesd ,
You can send me staff account with email: namphan992@gmail.com
I will check it.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024