Shopify立即购买按钮自定义

时间:2018-11-19 11:04:28

标签: javascript html scripting

我想编辑Shopify页面上的“立即购买”按钮,以重定向到另一个URL,该URL告诉他们该产品目前不可用,但是感谢他们购买此产品的兴趣。当我浏览源代码文件时,这是我在带有按钮的“产品”页面上看到的代码。

  {% comment %}
  The contents of the product.liquid template can be found in /sections/product-template.liquid
{% endcomment %}

{% section 'product-template' %}

{% if collection %}
  <div class="full-width full-width--return-link">
    <a href="{{ collection.url }}" class="h1 return-link">
      {% include 'icon-arrow-thin-left' %}
      {{ 'products.product.collection_return' | t: collection: collection.title }}
    </a>
  </div>
{% endif %}

<script>
  // Override default values of shop.strings for each template.
  // Alternate product templates can change values of
  // add to cart button, sold out, and unavailable states here.
  window.productStrings = {
    addToCart: {{ 'products.product.add_to_cart' | t | json }},
    soldOut: {{ 'products.product.sold_out' | t | json }},
    unavailable: {{ 'products.product.unavailable' | t | json }}
  }
</script>

1 个答案:

答案 0 :(得分:0)

您可以更改shopify主题内容,请按照以下步骤操作 转到在线商店> 操作> 编辑语言> 产品更改要更改的内容

相关问题