Created
February 9, 2017 08:31
-
-
Save davelowensohn/1ecdb7911ea35784495d021746f8f05c to your computer and use it in GitHub Desktop.
Shopify canonical_url - override with product.collections.last
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
{% if template contains 'product' and product.collections.size > 0 %} | |
<link rel="canonical" href="{{ shop.url }}{{ product.collections.last.url }}/products/{{product.handle}}" /> | |
{% else %} | |
<link rel="canonical" href="{{ canonical_url }}" /> | |
{% endif %} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment