首页 > 解决方案 > Shopify 立即购买按钮自定义

问题描述

我想编辑我的 Shopify 页面上的“立即购买”按钮,以重定向到另一个 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>

标签: javascripthtmlscripting

解决方案


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


推荐阅读