shopify - 添加消息提醒“选择您的尺码” 添加到购物车之前 shopify
问题描述
如何在添加到购物车之前添加消息提醒“选择您的尺码”shopify
我目前的代码是
{% include 'sca_freegift_price' with product %}
<script type="text/javascript">
var SPOCustom = {};
SPOCustom.selectorPrefix = '.product_section ';
</script>
<!-- spurit_po-added -->
{% include 'spurit_po-product-snippet' %}
<!-- /spurit_po-added -->
{% include 'shappify-bdl-no-select' %}
<script type="text/javascript">
var orig_array = new Object();
</script>
<div class="columns-fluid" itemscope itemtype="http://data-vocabulary.org/Product" id="product-{{ product.id }}">
<div class="section product_section clearfix">
{% include 'product-detail-snippet' %}
{% if settings.product_images_position == 'right' %}
<div class="{% if settings.product_sidebar %}six{% else %}eight{% endif %} columns {% if product-images == blank %}{% if settings.product_images_position == 'left' %}alpha{% else %}omega{% endif %}{% endif %}">
{% include 'product-images' %}
{% include "social-buttons" with "product" %}
</div>
{% endif %}
<script text="text/javascript">
$(document).ready(function(){
var cartAdd = {
Name: {{ product.title|json }},
ProductHandle: {{ product.handle | prepend: '"' | append: '"' }},
ProducePrice: {{sca_price | money | prepend: '"' | append: '"'}},
ProductID: {{ product.id|json }},
{% for image in product.images %}
Image{{ image.position}}: {{ image.src | product_img_url: 'medium'| prepend: '"http:' | append: '"' }},
{% endfor %}
Categories: {{ product.collections|map:'title'|json }}
};
function learnq(){
_learnq.push(['track', 'Added to Cart', cartAdd]);
}
$("#add-to-cart").click(learnq);
});
我正在编辑 product.liquid 文件,如果用户不选择尺寸,我需要显示消息警报“选择您的尺寸”,并且必须选择添加到购物车
解决方案
推荐阅读
- eclipse - 颠覆性连接器不可用
- c# - Unity覆盖`StandardAssetsScripts`的最佳方法
- linux - 通过 lldb 从 Linux(ARM32、Debian、RaspberryPi3B+)分析 .NET Core 控制台应用程序崩溃转储失败
- asp.net - 在 C# 中转换 JSON 格式
- python - 使用另一列上的键和字典中的值替换 pandas 列值
- vue.js - Vuetify 如何添加自定义主题
- java - 迭代并调用方法列表
- python - python web 抓取选项卡窗格
- crystal-reports - 删除/删除水晶报表中同一列和行中的特定文本
- spring-boot - 如何在spring boot中打印2个不同文件中2个类的日志