Saltar al contenido
Ejemplos de Scripts

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.

Reconstruido
Qué hacía el Script

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

Pruébalo en tu propia tienda

Pégalo en Rescate de scripts y mira qué reconstruye

  1. Copia el Ruby con el botón que hay junto a cualquier Script de esta página.
  2. En tu panel de Shopify, abre Stackable, luego Herramientas y luego Rescate de scripts.
  3. Pégalo ahí, lee lo que la herramienta dice que va a crear y compáralo con los ajustes de esta página.

Rescate de scripts está en el plan Pro. No se publica nada hasta que le digas cuánto descontaba tu Script antiguo y las dos cifras coincidan al céntimo.

El Script

Reconstruido
El Ruby original

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
En qué se convierte

Reconocido como Shipping discount y reconstruido como una oferta de tipo free_shipping. Estas son las claves de configuración reales con las que se guarda la oferta, así que puedes comparar tu propia reconstrucción campo por campo.

Cada ajuste, detallado
AjusteValorClave de configuración
Offer typefree_shippingtype
Countingper_cartcounting
Recurrenceoncerecurrence
Tier 1min spend $50.00 -> 100% offtiers[0]
Target scopealltarget.scope
MethodautomaticdiscountMethod
Allocationstandardstacking.allocation
Combines with other discountsnostacking
Se te pedirá que confirmes
  • Confirm which products this applies to. We could not read product targeting from the script.
Se te avisará
  • This discounts every shipping rate at checkout, not one named rate.
El carrito que lo demuestra

Creado en nuestra tienda de demostración pública, Meridian Goods, para que cada precio de aquí se pueda reproducir en lugar de darlo por bueno. El descuento de abajo es lo que calcula para este carrito exacto el mismo motor que se ejecuta en el pago.

El carrito que activa esta oferta, y lo que cuesta
ArtículoCant.Precio unit.
Ceramic Travel Mug1$22.00
Summit Insulated Bottle1$28.00
Subtotal$50.00
Envío, normalmente $6.90$0.00
Total$50.00

Sin sesión iniciada, o con sesión de un cliente sin etiquetas.

La cifra con la que la herramienta te compara

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.

El carrito que no debe producir nada
  • swap the cart for a single Braided USB-C Cable
El carrito que no debe activar esta oferta
ArtículoCant.Precio unit.
Braided USB-C Cable1$14.00
Subtotal$14.00
Total$14.00

Sin sesión iniciada, o con sesión de un cliente sin etiquetas.

Preguntas frecuentes

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.

Formas de Script relacionadas

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.

Pega tu Script y mira cómo se reconstruye

La reconstrucción se compara con el dinero que cobraba tu Script antiguo antes de que puedas publicarla.

Usamos cookies esenciales para el funcionamiento de este sitio y, solo con tu permiso, cookies analíticas para entender el tráfico. Lee nuestra Política de cookies.