Я пробовал несколько вариантов, но продолжаю терпеть неудачу со следующим кодом:
Этот код отлично работает в нескольких местах на моем сайте.
{% if product.price == 0.00 %}
<strong>P.O.A - Find Out More</strong>
{% else %}
Но я не могу заставить его работать с этим блоком кода в product-price.liquid: я пробовал несколько способов реализовать его, но он не сработает. Я всегда заканчиваю тем, что вижу £ 0,00
<div class="product-price {% if compare_at_price > price %}price--on-sale{% endif %}" data-price>
{% if compare_at_price > price %}
<span class="price-item-medium"><b>Standard Price:</b></span>
<span class="price-item price-item--regular money" data-product-id="{{ product.id }}" data-regular-price>
{{ compare_at_price | money }}
</span><be>
<span class="price-item"><b>Price With Discount:</b></span><span class="price-item price-item--sale" data-sale-price>
<span class="money" data-product-id="{{ variant.id }}">{{ price | money }}</span>
</span>
{% else %}
<span class="price-item price-item--regular" data-regular-price>
<span class="money" data-variant-id="{{ variant.id }}">{{ price | money }}</span>
</span>
<span class="price-item price-item--sale" data-sale-price></span>
</div>
{% endif %}
{% else %}
<div class="form-message form-message--error">
<strong>Prices are restricted</strong> <a href="/account/login">Login</a>, or <a href="/account/register">Register for an account</a>.
</div>
Вся помощь очень ценится.