Shopify Scripts 移行の実例集
当社が分類した Shopify Script のすべての型を、元の Ruby、移行後の姿、それを裏づける具体的なカート、そしてお断りする場合の理由まで省略せずに掲載しています。
- Script の型
- 42
- 現在再構築可
- 38
- 理由つきで不可
- 21
お断りする場合をこのページに載せる理由
移行ツールはできないことを公開しないため、特定の型の Script を探すマーチャントには宣伝しか見つかりません。ここに載せた不可の判断はすべて、理由、アプリが実際に表示する文言、そして理由が当社ではなく Shopify 側にある場合は Shopify のドキュメントへのリンクとともに記載しています。
このライブラリの不可 21 件のうち 13 件は当社の未実装であり、その旨を明記しています。2 件はどの割引アプリでも回避できない Shopify 側の制限で、4 件はそもそも割引ではなく、ページに記載した別種類の Shopify アプリが必要です。
Script の書かれ方
貼り付けられる Ruby の大半が使う 2 つの書き方と、それぞれから最初に読み取れること。
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.
価格と割合
価格を設定する、金額を引く、そしてマイナス記号 1 つだけが違う 2 つの型。
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、コード群をまとめて一致させる Script、コードを拒否する 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.
ファイル自体の問題
再構築にたどり着く前に、貼り付けた内容が読み取れなくなる 2 つのパターン。
One file holding several separate rules that ran one after another.
- Copied from a forum thread貼り付けを確認
A paste that lost its instance variables on the way through a forum post.