Skip to content

Instantly share code, notes, and snippets.

@katyayu
Created January 16, 2018 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katyayu/042612ad3eb60c7fefbf98e6f771ad0c to your computer and use it in GitHub Desktop.
Save katyayu/042612ad3eb60c7fefbf98e6f771ad0c to your computer and use it in GitHub Desktop.
<p class="product_name">
{% if template == 'index' %}
<a href="{{ product.url }}">{{ product.title | truncate:50 }}</a>
{% else %}
<a href="{{ product.url | within: collection }}">{{ product.title | truncate:50 }}</a>
{% endif %}
{% assign current_variant = product.selected_or_first_available_variant %} <span class="variant-sku">{{ current_variant.sku }}</span>
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment