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

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 API
この Script がしていたこと

It deleted matching delivery options from the list before checkout rendered it.

自分のストアで試す

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

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

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

Script 本体

別の Shopify API
元の Ruby

MAX_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
end
これはどうなるか

This 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 の型

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ポリシー.