Migrating a hide payment method script
Worth noticing that the show-a-gateway examples do not add anything: they delete everything that does not match. Show and hide are the same operation with the predicate flipped, and both end up in the same place.
別の Shopify APIIt deleted matching payment gateways from the list checkout offered.
スクリプトレスキューに貼り付けて、何が再現されるか確認する
- このページの各スクリプトの横にあるボタンで Ruby をコピーします。
- Shopify 管理画面で Stackable を開き、ツール、スクリプトレスキューの順に進みます。
- そこに貼り付け、ツールが作成すると示した内容を読み、このページの設定と見比べます。
スクリプトレスキューは Pro プランの機能です。以前のスクリプトの割引額を入力し、両方の金額が最小通貨単位まで一致するまで、何も公開されません。
Script 本体
別の Shopify APIHIDDEN_GATEWAY = "Cash on Delivery"
THRESHOLD = Money.new(cents: 5000)
if Input.cart.subtotal_price < THRESHOLD
Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway|
payment_gateway.name == HIDDEN_GATEWAY
end
else
Output.payment_gateways = Input.payment_gateways
endThis needs a different kind of Shopify app
Your Script hid, renamed, or reordered payment methods. Shopify builds that with the Payment Customization API, which Stackable does not ship.
Script のこの部分は割引ではありません。Shopify は上に挙げた別の種類の関数でこれを実現しますが、Stackable はそれを提供していません。
Shopify のドキュメントを読む理由キー: otherApi.paymentCustomization
何も作成されないため、ここに検証できるカートはありません。これを貼り付けても上のメッセージが出るだけで、キャンペーンは作成されません。
よくある質問
- Will Stackable rebuild this script?
- No, and the reason is stated rather than hidden: Your Script hid, renamed, or reordered payment methods. Shopify builds that with the Payment Customization API, which Stackable does not ship.
関連する Script の型
A cap on how many units a shopper could buy, enforced by trimming the cart.
Products that could not ship to the shopper’s country, quietly deleted.