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.
RicostruitoIt discounted every delivery rate to zero once the cart subtotal passed a threshold.
Incollalo in Recupero Script e guarda cosa ricostruisce
- Copia il Ruby con il pulsante accanto a ogni Script di questa pagina.
- Nell'admin di Shopify apri Stackable, poi Strumenti, poi Recupero Script.
- Incollalo lì, leggi cosa dichiara di costruire lo strumento e confrontalo con le impostazioni di questa pagina.
Recupero Script è nel piano Pro. Non viene pubblicato nulla finché non dichiari quanto scontava il vecchio Script e le due cifre non coincidono al centesimo.
Lo Script
RicostruitoInput.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_ratesRiconosciuto come Shipping discount e ricostruito come offerta di tipo free_shipping. Queste sono le vere chiavi di configurazione con cui l'offerta viene salvata, così puoi confrontare la tua ricostruzione campo per campo.
| Impostazione | Valore | Chiave di configurazione |
|---|---|---|
| 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.
Creato sul nostro negozio demo pubblico, Meridian Goods, così ogni prezzo qui si può riprodurre invece di doverci credere sulla parola. Lo sconto qui sotto è quello che lo stesso motore che gira al checkout calcola per questo esatto carrello.
| Articolo | Qtà | Prezzo unit. |
|---|---|---|
| Ceramic Travel Mug | 1 | $22.00 |
| Summit Insulated Bottle | 1 | $28.00 |
| Subtotale | $50.00 | |
| Consegna, di norma $6.90 | $0.00 | |
| Totale | $50.00 | |
Nessun accesso, oppure accesso come cliente senza tag.
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
| Articolo | Qtà | Prezzo unit. |
|---|---|---|
| Braided USB-C Cable | 1 | $14.00 |
| Subtotale | $14.00 | |
| Totale | $14.00 | |
Nessun accesso, oppure accesso come cliente senza tag.
Domande frequenti
- 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.
Forme di Script correlate
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.
Incolla il tuo Script e guardalo ricostruito
La ricostruzione viene confrontata con l'importo che il tuo vecchio Script applicava, prima che tu possa pubblicarla.