首页 > 解决方案 > Shopify 边框选择颜色

问题描述

我有 shopify 商店,我在互联网上找到了一个代码,可以用他的图像替换颜色,就像这样

我真的需要在选择颜色时添加边框,有人可以帮我吗?

代码是这样做的:

{%if option.name == "Couleur"%}
  <label>{{option.name}}</label>
  {%assign index = forloop.index %}
  {%for value in option.values%}
    <input class="single-option-selector-{{ section.id }}" id="Couleur-{{forloop.index}}" type="radio" style='visibility:hidden;display:none' name="Couleur" value="{{ value | escape }}" data-index="option{{index}}" {% if option.selected_value == value %}checked{%endif%}/>
    <label id="colorSelected" class="label_couleur" for="Couleur-{{forloop.index}}" style="margin: 0 5px;">
      <img class="img_couleur"  src="{{value | escape | append:'.jpg' | strip | asset_url }}"/>      
    </label>
  {%endfor%}
{%else%}

我真的需要帮助提前谢谢。

标签: shopifyshopify-javascript-buy-sdk

解决方案


您可以参考 Shopify 社区论坛,提供了为产品中的颜色创建色板图像的解决方案。请点击这里查看实现。

此解决方案不适用于冒险和无限主题。我在首次亮相主题中实现的是为客户商店工作。


推荐阅读