Pular para o conteúdo
Exemplos de Scripts

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 Shopify
O que o Script fazia

It deleted matching payment gateways from the list checkout offered.

Teste na sua própria loja

Cole no Resgate de Scripts e veja o que ele reconstrói

  1. Copie o Ruby no botão ao lado de qualquer Script desta página.
  2. No admin da Shopify, abra o Stackable, depois Ferramentas e depois Resgate de Scripts.
  3. 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 Shopify
O Ruby original

HIDDEN_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
end
O que acontece com este

This 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 Shopify

Chave 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

Purchase quantity limit

A cap on how many units a shopper could buy, enforced by trimming the cart.

Remove products by country

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.

Usamos cookies essenciais para operar este site e, apenas com sua permissão, cookies de análise para entender o tráfego. Leia nossa Política de Cookies.