【发布时间】:2020-10-21 09:00:32
【问题描述】:
我想在“添加到购物车”按钮中添加价格。
如您所见,我可以在按钮中添加价格,但是当我更改变体时,它会消失。 (网址会随着选择不同的变体而变化)
有什么建议吗?
目前的代码是:
<button
{% if product.empty? %}type="button"{% else %}type="submit"{% endif %}
name="add"
id="AddToCart-{{ section_id }}"
class="btn btn--full add-to-cart{% if enable_dynamic_buttons %} btn--secondary{% endif %}"
{% unless current_variant.available %} disabled="disabled"{% endunless %}>
<span id="AddToCartText-{{ section_id }}" data-default-text="{{ default_text }}">
{{ button_text }} {{ current_variant.price | money }}
</span>
</button>
【问题讨论】:
标签: javascript shopify liquid