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.
スクリプトレスキューに貼り付けて、何が再現されるか確認する
- このページの各スクリプトの横にあるボタンで Ruby をコピーします。
- Shopify 管理画面で Stackable を開き、ツール、スクリプトレスキューの順に進みます。
- そこに貼り付け、ツールが作成すると示した内容を読み、このページの設定と見比べます。
スクリプトレスキューは Pro プランの機能です。以前のスクリプトの割引額を入力し、両方の金額が最小通貨単位まで一致するまで、何も公開されません。
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.