Migrating a reject discount code script
This one changed under everyone’s feet. Rejecting a typed code was impossible for a discount function until December 2025 and is possible now, with one restriction that decides whether your file can be rebuilt.
尚未支持It rejected the discount code the shopper had entered and showed them a reason.
把它粘贴到 Scripts 救援,看看会重建成什么
- 用本页任意 Script 旁边的按钮复制 Ruby 代码。
- 在 Shopify 后台打开 Stackable,依次进入工具、Scripts 救援。
- 粘贴进去,读一读工具说它会创建什么,再和本页的设置逐项对照。
Scripts 救援属于 Pro 套餐。在您填写旧 Script 的折扣金额、且两个数字精确到最小货币单位完全一致之前,不会发布任何内容。
Script 本体
尚未支持REJECTION_MESSAGE = "Discount codes cannot be used during a sale"
unless Input.cart.discount_code.nil?
Input.cart.discount_code.reject(message: REJECTION_MESSAGE)
end
Output.cart = Input.cartWe have not built this yet
Your Script turned away a discount code the shopper typed. Shopify allows that only from an automatic discount, so we can rebuild it if this campaign runs automatically rather than on its own code.
这是我们的缺失,不是 Shopify 的。Shopify 允许这么做,我们还没有实现,所以这里没有可链接的内容,也没有理由怪平台。
原因键: unsupported.rejectDiscountCodeOnCodeCampaign
这里没有可供验证的购物车,因为什么都不会生成。粘贴它只会得到上面的提示,不会创建任何活动。
常见问题
- Will Stackable rebuild this script?
- No, and the reason is stated rather than hidden: Your Script turned away a discount code the shopper typed. Shopify allows that only from an automatic discount, so we can rebuild it if this campaign runs automatically rather than on its own code.
相关的 Script 类型
Script logic that only ran when the shopper had typed a particular code.
A whole family of codes driving one rule through a prefix match.