【发布时间】:2015-10-26 17:18:12
【问题描述】:
我正在尝试将变体标题“颜色”更改为“风味”。我试图在代码中更改它但不起作用。我有数以千计的产品,为每种产品更改颜色将是很多工作的方式。下面列出了标题颜色显示的代码。这甚至可能吗?
<select name="id" id="productSelect" class="product-variants">
{% for variant in product.variants %}
{% if variant.available %}
<option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>
{% else %}
<option disabled="disabled">
{{ variant.title }} - {{ 'products.product.sold_out' | t }}
</option>
{% endif %}
{% endfor %}
</select>
【问题讨论】: