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.
GenopbyggetIt discounted every delivery rate to zero once the cart subtotal passed a threshold.
Indsæt det i Scripts-redning, og se hvad der bliver bygget
- Kopiér Ruby-koden med knappen ved siden af ethvert Script på siden.
- Åbn Stackable i Shopify-administrationen, derefter Værktøjer og så Scripts-redning.
- Indsæt det der, læs hvad værktøjet siger, det vil bygge, og hold det op mod indstillingerne på denne side.
Scripts-redning hører til Pro-abonnementet. Intet bliver udgivet, før du oplyser, hvad dit gamle Script gav i rabat, og de to beløb stemmer helt ned på øret.
Selve dette Script
GenopbyggetInput.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_ratesGenkendt som Shipping discount og genopbygget som et tilbud af typen free_shipping. Det her er de rigtige konfigurationsnøgler, som tilbuddet gemmes med, så du kan tjekke din egen genopbygning felt for felt.
| Indstilling | Værdi | Konfigurationsnøgle |
|---|---|---|
| Offer type | free_shipping | type |
| Counting | per_cart | counting |
| Recurrence | once | recurrence |
| Tier 1 | min spend $50.00 -> 100% off | tiers[0] |
| Target scope | all | target.scope |
| Method | automatic | discountMethod |
| Allocation | standard | stacking.allocation |
| Combines with other discounts | no | stacking |
- 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.
Bygget i vores offentlige demobutik, Meridian Goods, så hver pris her kan efterregnes i stedet for at blive taget på tro. Rabatten nedenfor er det, som den samme motor, der kører i kassen, beregner for præcis denne kurv.
| Vare | Antal | Stykpris |
|---|---|---|
| Ceramic Travel Mug | 1 | $22.00 |
| Summit Insulated Bottle | 1 | $28.00 |
| Subtotal | $50.00 | |
| Levering, normalt $6.90 | $0.00 | |
| Total | $50.00 | |
Logget ud, eller logget ind som kunde uden tags.
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.
- swap the cart for a single Braided USB-C Cable
| Vare | Antal | Stykpris |
|---|---|---|
| Braided USB-C Cable | 1 | $14.00 |
| Subtotal | $14.00 | |
| Total | $14.00 | |
Logget ud, eller logget ind som kunde uden tags.
Ofte stillede spørgsmål
- 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ægtede Script-typer
A share taken off every delivery rate at checkout.
A flat sum off the delivery charge, floored at free.
Every delivery rate rewritten to one price rather than reduced by an amount.
Indsæt dit Script og se det blive genopbygget
Genopbygningen holdes op mod det beløb, dit gamle Script opkrævede, før du kan udgive den.