Migrating an exclude subscription items script
The stakes are higher here than anywhere else in the library. A one-off discount applied to a wrong line is one order; a subscription priced wrong is every renewal until somebody notices.
尚未支持It skipped any line that had been added on a selling plan.
把它粘贴到 Scripts 救援,看看会重建成什么
- 用本页任意 Script 旁边的按钮复制 Ruby 代码。
- 在 Shopify 后台打开 Stackable,依次进入工具、Scripts 救援。
- 粘贴进去,读一读工具说它会创建什么,再和本页的设置逐项对照。
Scripts 救援属于 Pro 套餐。在您填写旧 Script 的折扣金额、且两个数字精确到最小货币单位完全一致之前,不会发布任何内容。
Script 本体
尚未支持DISCOUNT_PERCENTAGE = 20
Input.cart.line_items.each do |line_item|
next unless line_item.selling_plan_id.nil?
line_item.change_line_price(
line_item.line_price * (1.0 - (DISCOUNT_PERCENTAGE / 100.0)),
message: "20% off one-time purchases"
)
end
Output.cart = Input.cartWe have not built this yet
Your Script treated subscription items differently. Shopify does tell us which items are subscriptions, but our checkout query is already at Shopify's cost limit, so we cannot ask for it today.
这是我们的缺失,不是 Shopify 的。Shopify 允许这么做,我们还没有实现,所以这里没有可链接的内容,也没有理由怪平台。
原因键: unsupported.subscriptionExclusion
这里没有可供验证的购物车,因为什么都不会生成。粘贴它只会得到上面的提示,不会创建任何活动。
常见问题
- Will Stackable rebuild this script?
- No, and the reason is stated rather than hidden: Your Script treated subscription items differently. Shopify does tell us which items are subscriptions, but our checkout query is already at Shopify's cost limit, so we cannot ask for it today.
相关的 Script 类型
A discount limited to products carrying one tag, vendor or type.
Already-marked-down products protected from a second discount.
Gift cards left out of a discount that would otherwise have hit them.