Shopify Scripts 迁移示例
我们收录的每一种 Shopify Script 类型,附有原始 Ruby、迁移后的形态、用于验证的具体购物车,以及完整写明的拒绝理由。
- Script 类型
- 42
- 当前可重建
- 38
- 已拒绝,附原因
- 21
为什么把拒绝写在这一页
没有哪个迁移工具会公布自己做不到的事,于是商家在查找某一种具体的 Script 类型时,只能找到营销内容。这里的每一条拒绝都写明了原因、应用实际显示的文案,以及在原因出自 Shopify 而非我们时指向 Shopify 官方文档的链接。
本库 21 条拒绝中,有 13 条是我们自己的缺失,我们直说。2 条是任何折扣应用都绕不开的 Shopify 限制,另有 4 条根本不是折扣,它们需要页面上注明的另一类 Shopify 应用。
您的 Script 是怎么写的
大多数被粘贴的 Ruby 使用的两种写法,以及每种写法一眼就能看出的信息。
The dialect Shopify’s own documentation taught, with its settings block above a do-not-edit banner.
Generator output, with a CAMPAIGNS array at the bottom that states the merchant’s intent as data.
价格与百分比
设定价格、减去金额,以及只差一个负号的那一对。
Everything in the clearance line repriced to one round number per unit.
A flat sum taken off every unit, however many the shopper bought.
One lump sum off the whole cart, spread across the lines.
One percentage off the whole catalogue, with no condition attached.
A percentage with a ceiling on it, so a large cart never gave away more than a set maximum.
Tax-inclusive prices reduced for shoppers outside the VAT area.
数量、BOGO 与赠品件数
买赠类优惠,以及决定赠出多少的计数方式。
A set of paid units earns an extra unit at no charge.
The same buy-and-get offer, counted so the reward sits inside each set rather than beside it.
The discount applied to the first few units only, with the rest at full price.
The least expensive thing in the cart discounted, once.
Buy-and-get applied to the whole eligible selection rather than within one line.
消费门槛
购物车金额达到一定数额后解锁的奖励。
A percentage that unlocks once the cart is worth enough.
A flat sum off the order once the cart crosses a value.
- Discounted cart subtotalShopify 平台限制
A threshold read from what was left after a code had already come off.
配送
为配送打折,以及那些其实并不是折扣的配送 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.
Delivery drops to free once the cart is worth enough.
Free delivery for one group of customers and nobody else.
One delivery option discounted while the others stayed at full price.
Delivery went free because of what was in the cart, not what it was worth.
- Hide shipping rates另一种 Shopify API
A delivery option removed from checkout under a condition.
折扣面向谁
客户标签、订单历史和累计消费。
A discount for shoppers with no order history, or with enough of it.
A new-customer gate wrapped around a cheapest-item reward.
A reward for customers who had spent enough over their lifetime.
A discount only tagged customers ever saw.
折扣码
监测某个折扣码、匹配一整类折扣码,或拒绝折扣码的 Script。
A code the shopper typed, turned away at checkout with a message.
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.
适用范围与排除
折扣可以作用于什么,以及必须避开什么。
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.
A discount keyed on a property attached to one cart line.
Subscription lines held apart from the discount that hit everything else.
- Skip already discounted itemsShopify 平台限制
Lines another discount had already touched, held back from a second one.
根本不是折扣
改变购物车或结账流程而不是价格的 Script。
- Purchase quantity limit另一种 Shopify API
A cap on how many units a shopper could buy, enforced by trimming the cart.
- Remove products by country另一种 Shopify API
Products that could not ship to the shopper’s country, quietly deleted.
- Hide a payment method另一种 Shopify API
A payment option taken off checkout under a condition.
文件本身的问题
两种情况会让粘贴内容在重建开始前就无法读取。
One file holding several separate rules that ran one after another.
A paste that lost its instance variables on the way through a forum post.