文章分类: Pareto Volume discount
本条还可参阅:

应用嵌入与区块添加指南

为确保应用正常运行并与您的店铺兼容,您需要启用应用嵌入功能,并在需要展示折扣的页面添加应用区块。

1. 启用应用嵌入


进入应用*仪表盘** -> 点击**启用**按钮跳转至主题编辑界面

开启*Omega Quantity**应用 -> 点击**保存**完成设置

2. 商品页面添加区块


选择商品页面模板

点击*添加区块** -> 选择**Omega Quantity Block**应用

拖动至目标位置 -> 点击*保存**

3. 购物车页面添加区块


选择购物车页面模板

点击*添加区块** -> 选择**Omega Quantity - Cartpage**应用

拖动至目标位置 -> 点击*保存**

4. 首页添加区块


选择商品页面模板 -> 进入精选商品版块

点击*添加区块** -> 选择**Omega Quantity - Homepage**应用

拖动至目标位置 -> 点击*保存**

5. 商品集合页面代码添加


进入主题 -> "编辑代码"

在collection.liquid或card-product.liquid文件中目标位置添加以下代码:

liquid
Copy
Download
{% assign result_collection = "" %}
{% for collection in card_product.collections %}
    {% if forloop.first == false %}
    {% assign result_collection = result_collection | append: "," %}
    {% endif %}
    {% assign result_collection = result_collection | append: collection.id %}
{% endfor %}

<div class="omg-discount-notification" data-product-id="{{ card_product.id }}" data-collections="{{ result_collection }}"></div>

<script>
    if (typeof window.omgProductList === "undefined") {
        window.omgProductList = [];
    }

    (function(){
        const product = {
            id: {{ card_product.id | json }},
            title: {{ card_product.title | json }},
            handle: {{ card_product.handle | json }},
            variants: [
            {% for variant in card_product.variants %}
                {
                id: {{ variant.id | json }},
                title: {{ variant.title | json }},
                price: {{ variant.price | json }},
                available: {{ variant.available | json }}
                }
                {% unless forloop.last %},{% endunless %}
            {% endfor %}
            ]
        };

        const productExists = window.omgProductList.some(p => p.id === product.id);
        if (!productExists) {
            window.omgProductList.push(product);
        }
    })();
</script>



6. 结账页面添加区块


进入**加购交叉销售**菜单 -> 点击设置说明区域的**前往主题**按钮
https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image&lowbar;1scdo3q.png
系统将跳转至*主题编辑器**
选择目标位置 -> 添加*Pareto - Cross sell**区块

点击*保存**完成设置

更新于: 24/06/2025

这篇文章有帮助吗?

分享您的反馈意见

取消

谢谢!