コンテンツにスキップ
Script 実例集

Migrating a free shipping over a threshold script

If a Plus store had exactly one shipping script, it was this one. It is also the entry where the app’s own preview and the real checkout quote different savings on purpose, and knowing why is worth two minutes on camera.

再構築可
この Script がしていたこと

It discounted every delivery rate to zero once the cart subtotal passed a threshold.

自分のストアで試す

スクリプトレスキューに貼り付けて、何が再現されるか確認する

  1. このページの各スクリプトの横にあるボタンで Ruby をコピーします。
  2. Shopify 管理画面で Stackable を開き、ツール、スクリプトレスキューの順に進みます。
  3. そこに貼り付け、ツールが作成すると示した内容を読み、このページの設定と見比べます。

スクリプトレスキューは Pro プランの機能です。以前のスクリプトの割引額を入力し、両方の金額が最小通貨単位まで一致するまで、何も公開されません。

Script 本体

再構築可
元の Ruby

Input.shipping_rates.each do |shipping_rate|
  if Input.cart.subtotal_price >= Money.new(cents: 5000)
    shipping_rate.apply_discount(shipping_rate.price, message: "Free shipping over $50")
  end
end

Output.shipping_rates = Input.shipping_rates
何になるか

Shipping discount として認識され、free_shipping タイプのオファーとして再構築されます。以下はオファーが実際に保存される設定キーそのものなので、ご自身の再構築結果を項目ごとに照合できます。

すべての設定項目
設定項目設定キー
Offer typefree_shippingtype
Countingper_cartcounting
Recurrenceoncerecurrence
Tier 1min spend $50.00 -> 100% offtiers[0]
Target scopealltarget.scope
MethodautomaticdiscountMethod
Allocationstandardstacking.allocation
Combines with other discountsnostacking
確認を求められます
  • Confirm which products this applies to. We could not read product targeting from the script.
次の点が表示されます
  • This discounts every shipping rate at checkout, not one named rate.
それを裏づけるカート

公開デモストア Meridian Goods で作成しているため、ここに載せた価格はすべて、信じるのではなく再現して確かめられます。以下の割引額は、決済時に動くのと同じエンジンがこのカートに対して算出した金額です。

このオファーが発動するカートと、その金額
商品数量単価
Ceramic Travel Mug1$22.00
Summit Insulated Bottle1$28.00
小計$50.00
配送、通常は $6.90$0.00
合計$50.00

未ログイン、またはタグのない顧客としてログインしています。

ツールが照合する金額

This rebuild only changes shipping. We price shipping against a sample rate rather than the rate your shopper saw, so there is no figure here we could honestly compare. Publishing records that the amount was not checked.

何も起きてはいけないカート
  • swap the cart for a single Braided USB-C Cable
このオファーが発動してはいけないカート
商品数量単価
Braided USB-C Cable1$14.00
小計$14.00
合計$14.00

未ログイン、またはタグのない顧客としてログインしています。

よくある質問

Will Stackable rebuild this script?
Yes. Every spelling on this page is rebuilt today as a free_shipping offer, and the cart above is the one that proves it.
What cart proves it works?
1 x Ceramic Travel Mug at $22.00 plus 1 x Summit Insulated Bottle at $28.00. The engine takes $6.90 off, and checkout charges $50.00 plus $0.00 delivery.
What will I have to check before publishing?
Confirm which products this applies to. We could not read product targeting from the script. This discounts every shipping rate at checkout, not one named rate.

関連する Script の型

Percentage off shipping

A share taken off every delivery rate at checkout.

Amount off shipping

A flat sum off the delivery charge, floored at free.

Flat rate shipping

Every delivery rate rewritten to one price rather than reduced by an amount.

Script を貼り付けて再構築を確認

再構築の結果は、公開する前に、以前の Script が請求していた金額と照合されます。

本サイトの運営には必須Cookieを使用しており、お客様の同意をいただいた場合のみ、アクセス状況を把握するための分析Cookieを使用します。詳細は Cookieポリシー.