Migrating a hide shipping rates script
Where most shipping pastes land. The in-app picker offered four shipping templates and three of them hid, renamed or reordered rates, which is a different Shopify feature now and not a discount at all.
另一种 Shopify APIIt deleted matching delivery options from the list before checkout rendered it.
把它粘贴到 Scripts 救援,看看会重建成什么
- 用本页任意 Script 旁边的按钮复制 Ruby 代码。
- 在 Shopify 后台打开 Stackable,依次进入工具、Scripts 救援。
- 粘贴进去,读一读工具说它会创建什么,再和本页的设置逐项对照。
Scripts 救援属于 Pro 套餐。在您填写旧 Script 的折扣金额、且两个数字精确到最小货币单位完全一致之前,不会发布任何内容。
Script 本体
另一种 Shopify APIMAX_GRAMS = 10000
if Input.cart.total_weight > MAX_GRAMS
Output.shipping_rates = Input.shipping_rates.delete_if do |shipping_rate|
shipping_rate.name == "Express"
end
else
Output.shipping_rates = Input.shipping_rates
endThis needs a different kind of Shopify app
Your Script hid, renamed, or reordered shipping rates. Shopify builds that with the Delivery Customization API, which Stackable does not ship.
Script 的这一部分不是折扣。Shopify 用上面提到的另一种函数类型来实现它,而 Stackable 并不提供那种函数。
阅读 Shopify 官方文档原因键: otherApi.deliveryCustomization
这里没有可供验证的购物车,因为什么都不会生成。粘贴它只会得到上面的提示,不会创建任何活动。
常见问题
- Will Stackable rebuild this script?
- No, and the reason is stated rather than hidden: Your Script hid, renamed, or reordered shipping rates. Shopify builds that with the Delivery Customization API, which Stackable does not ship.
相关的 Script 类型
A share taken off every delivery rate at checkout.
A flat sum off the delivery charge, floored at free.
Every delivery rate rewritten to one price rather than reduced by an amount.