Saltar al contenido
Ejemplos de Scripts

Migrating a first order discount script

This appears in Shopify’s own repo, in the Help Center library and in the generator, which is more independent official appearances than almost any other script shape. Note that most versions treat a logged-out shopper as a first-time buyer.

Aún no admitido
Qué hacía el Script

It compared the customer’s past order count to a number before applying anything.

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

Aún no admitido
El Ruby original

DISCOUNT_PERCENTAGE = 20

if Input.cart.customer.nil? || Input.cart.customer.orders_count < 1
  Input.cart.line_items.each do |line_item|
    line_item.change_line_price(
      line_item.line_price * (1.0 - (DISCOUNT_PERCENTAGE / 100.0)),
      message: "20% off your first order"
    )
  end
end

Output.cart = Input.cart
Qué pasa con este

We have not built this yet

Your Script checked how many orders the customer had placed. Shopify can tell us, but our checkout query is already at Shopify's cost limit, so we cannot ask for it today.

Es una carencia nuestra, no de Shopify. Shopify lo permite y nosotros no lo hemos construido, así que aquí no hay nada que enlazar ni nada que echarle a la plataforma.

Clave del motivo: unsupported.customerOrderCount

Aquí no hay carrito que probar, porque no se construye nada. Pegar esto produce el mensaje de arriba y ninguna campaña.

Preguntas frecuentes

Will Stackable rebuild this script?
No, and the reason is stated rather than hidden: Your Script checked how many orders the customer had placed. Shopify can tell us, but our checkout query is already at Shopify's cost limit, so we cannot ask for it today.

Formas de Script relacionadas

First time customer, cheapest item

A new-customer gate wrapped around a cheapest-item reward.

Lifetime spend discount

A reward for customers who had spent enough over their lifetime.

Customer tag discount

A discount only tagged customers ever saw.

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.