Hoppa till innehåll
Script-exempel

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.

Annat Shopify-API
Vad detta Script gjorde

It deleted matching payment gateways from the list checkout offered.

Testa det i din egen butik

Klistra in det i Scripts-räddning och se vad som byggs

  1. Kopiera Ruby-koden med knappen bredvid vilket Script som helst på sidan.
  2. Öppna Stackable i Shopify-adminen, sedan Verktyg, sedan Scripts-räddning.
  3. Klistra in det där, läs vad verktyget säger att det ska bygga och jämför med inställningarna på den här sidan.

Scripts-räddning ingår i Pro-planen. Ingenting publiceras förrän du anger vad ditt gamla Script gav i rabatt och båda beloppen stämmer på öret.

Detta Script

Annat Shopify-API
Den ursprungliga Ruby-koden

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
Vad som händer med den här

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.

Den här delen av ett Script är inte en rabatt. Shopify bygger den med en annan funktionstyp, namngiven ovan, som Stackable inte levererar.

Läs Shopifys dokumentation

Orsaksnyckel: otherApi.paymentCustomization

Det finns ingen varukorg att testa här, eftersom ingenting byggs. Att klistra in det här ger meddelandet ovan och ingen kampanj alls.

Vanliga frågor

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.

Besläktade Script-former

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.

Klistra in ditt Script och se det byggas om

Ombyggnaden stäms av mot beloppet som ditt gamla Script tog ut innan du kan publicera den.

Vi använder nödvändiga cookies för att driva den här webbplatsen, och, bara med ditt tillstånd, analyscookies för att förstå trafiken. Läs vår Cookiepolicy.