我在shopify上建立了一个电子商务网站,我想在产品中添加颜色样本,但只为一个选项(例如颜色),而不是所有的。我根据这个教程http://docs.shopify.com/manual/configuration/store-customization/add-color-swatches-to-your-products做了所有的更改,它工作得很好,但对于所有的选项。有没有办法只将一个选项显示为色样?
提前感谢
发布于 2014-06-22 14:00:18
如果您关注过this tutorial,则只需使用put this in product.liquid即可将样例限制为一个选项:
{% if product.available and product.variants.size > 1 %}
{% include 'swatch' with 'Color' %}
{% endif %}(将Color替换为您希望成为样例/按钮的选项的名称)
https://stackoverflow.com/questions/20715171
复制相似问题