Hoppa till innehåll
Script-exempel

Migrating a free shipping over a threshold script

If a Plus store had exactly one shipping script, it was this one. It is also the entry where the app’s own preview and the real checkout quote different savings on purpose, and knowing why is worth two minutes on camera.

Ombyggt
Vad detta Script gjorde

It discounted every delivery rate to zero once the cart subtotal passed a threshold.

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

Ombyggt
Den ursprungliga Ruby-koden

Input.shipping_rates.each do |shipping_rate|
  if Input.cart.subtotal_price >= Money.new(cents: 5000)
    shipping_rate.apply_discount(shipping_rate.price, message: "Free shipping over $50")
  end
end

Output.shipping_rates = Input.shipping_rates
Vad det blir

Identifierat som Shipping discount och ombyggt till ett erbjudande av typen free_shipping. Det här är de verkliga konfigurationsnycklarna som erbjudandet sparas med, så du kan stämma av din egen ombyggnad fält för fält.

Varje inställning, utskriven
InställningVärdeKonfigurationsnyckel
Offer typefree_shippingtype
Countingper_cartcounting
Recurrenceoncerecurrence
Tier 1min spend $50.00 -> 100% offtiers[0]
Target scopealltarget.scope
MethodautomaticdiscountMethod
Allocationstandardstacking.allocation
Combines with other discountsnostacking
Du kommer att få bekräfta
  • Confirm which products this applies to. We could not read product targeting from the script.
Du kommer att få veta
  • This discounts every shipping rate at checkout, not one named rate.
Varukorgen som bevisar det

Byggd i vår publika demobutik, Meridian Goods, så att varje pris här går att räkna efter i stället för att tas på förtroende. Rabatten nedan är vad samma motor som kör i kassan räknar fram för exakt den här varukorgen.

Varukorgen som utlöser erbjudandet, och vad det kostar
ArtikelAntalStyckpris
Ceramic Travel Mug1$22.00
Summit Insulated Bottle1$28.00
Delsumma$50.00
Leverans, normalt $6.90$0.00
Summa$50.00

Utloggad, eller inloggad som kund utan taggar.

Beloppet som verktyget stämmer av dig mot

This rebuild only changes shipping. We price shipping against a sample rate rather than the rate your shopper saw, so there is no figure here we could honestly compare. Publishing records that the amount was not checked.

Varukorgen som inte får ge något alls
  • swap the cart for a single Braided USB-C Cable
Varukorgen som inte får utlösa erbjudandet
ArtikelAntalStyckpris
Braided USB-C Cable1$14.00
Delsumma$14.00
Summa$14.00

Utloggad, eller inloggad som kund utan taggar.

Vanliga frågor

Will Stackable rebuild this script?
Yes. Every spelling on this page is rebuilt today as a free_shipping offer, and the cart above is the one that proves it.
What cart proves it works?
1 x Ceramic Travel Mug at $22.00 plus 1 x Summit Insulated Bottle at $28.00. The engine takes $6.90 off, and checkout charges $50.00 plus $0.00 delivery.
What will I have to check before publishing?
Confirm which products this applies to. We could not read product targeting from the script. This discounts every shipping rate at checkout, not one named rate.

Besläktade Script-former

Percentage off shipping

A share taken off every delivery rate at checkout.

Amount off shipping

A flat sum off the delivery charge, floored at free.

Flat rate shipping

Every delivery rate rewritten to one price rather than reduced by an amount.

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.