I'm working on a Shopify (slate) theme with very limited experience. There's a few classes I need to add which I've managed on images but can't find a way to do this on an anchor included within <h2 class="mosaic__title p-name">{{ item.title | link_to: item.url }}</h2>
.
Also I have some prices that has text like "On Sale from" injected before it. I don't know how this is added or how to remove it. Here's an example:
<del>{{ item.compare_at_price | money }}</del>
{% assign sale_price = item.price | money %}
{{ 'products.product.on_sale_from_html' | t: price: sale_price }}
I've tried removing the .on_sale_from_html
and t: price: sale_price
but that doesn't work/it breaks.
Can anyone advise on this? Thanks!
Full section of code for reference:
<div class="mosaic__caption">
<h2 class="mosaic__title p-name">{{ item.title | link_to: item.url }}</h2>
{% if item.object_type == 'product' %}
<p class="mosaic__value">
{% if item.compare_at_price > item.price %}
{% if item.price_varies %}
<del>{{ item.compare_at_price | money }}</del>
{% assign sale_price = item.price | money %}
{{ 'products.product.on_sale_from_html' | t: price: sale_price }}
{% else %}
{{ 'products.product.on_sale' | t }}
<data itemprop="price" class="p-price">{{ item.price | money }}</data>
{% endif %}
<data class="visually-hidden p-price">{{ 'products.product.regular_price' | t }}</data>
{% else %}
{% if item.price_varies %}
{% assign price = item.price | money %}
<data itemprop="price" class="p-price">{{ 'products.product.from_text_html' | t: price: price }}</data>
{% else %}
<data itemprop="price" class="p-price">{{ item.price | money }}</data>
{% endif %}
{% endif %}
{% unless item.available %}
{{ 'products.product.sold_out' | t }}
{% endunless %}
</p>
{% else %}
<p>{{ item.content | strip_html | truncatewords: 50 }}</p>
{% endif %}
</div>