javascript - 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>
解决方案
您可以更改 shopify 主题内容请按照以下步骤转到在线商店>操作>编辑语言>要更改的产品更改内容
推荐阅读
- c# - 我无法使用基于 cUrl 的证书制作 HttpClient Post
- python-3.x - 尝试使用 glob.glob 对多个文件夹中的部分文件名进行模式匹配
- .net-core - IBM MQ 和 .NET Core 应用程序
- javascript - 在 `it` 语句中循环通过 Protractor 的代码
- spring - 当我从 Spring 1.5.21 升级到 2.1.5 时,pom.xml 中出现“未知”错误
- unity3d - Unity:如何通过拖动触摸来旋转第一人称相机?
- spring - 使用 Freemarker 比较 String 和 Spring Security 标签
- java - Java DBUnit AmbiguousTableNameException 错误抛出
- lambda - 是否可以定义存储与参数具有相同数据类型的 lambda 函数的数据类型?
- html - noob div 标签问题 - 自动调整大小和定位