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.
Outra API da ShopifyIt deleted matching payment gateways from the list checkout offered.
Cole no Resgate de Scripts e veja o que ele reconstrói
- Copie o Ruby no botão ao lado de qualquer Script desta página.
- No admin da Shopify, abra o Stackable, depois Ferramentas e depois Resgate de Scripts.
- Cole lá, leia o que a ferramenta diz que vai criar e compare com as configurações desta página.
O Resgate de Scripts está no plano Pro. Nada é publicado até você informar quanto o Script antigo descontava e os dois valores baterem no centavo.
O Script
Outra API da ShopifyHIDDEN_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.
Esta parte de um Script não é um desconto. A Shopify constrói isso com outro tipo de função, citado acima, que o Stackable não oferece.
Leia a documentação da ShopifyChave do motivo: otherApi.paymentCustomization
Não há carrinho para testar aqui, porque nada é criado. Colar isso produz a mensagem acima e nenhuma campanha.
Perguntas frequentes
- 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.
Formatos de Script relacionados
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.
Cole o seu Script e veja a reconstrução
A reconstrução é comparada com o valor que o seu Script antigo cobrava antes de você poder publicá-la.