Saltar al contenido
Ejemplos de Scripts

Migrating an exclude subscription items script

The stakes are higher here than anywhere else in the library. A one-off discount applied to a wrong line is one order; a subscription priced wrong is every renewal until somebody notices.

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

It skipped any line that had been added on a selling plan.

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

Input.cart.line_items.each do |line_item|
  next unless line_item.selling_plan_id.nil?
  line_item.change_line_price(
    line_item.line_price * (1.0 - (DISCOUNT_PERCENTAGE / 100.0)),
    message: "20% off one-time purchases"
  )
end

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

We have not built this yet

Your Script treated subscription items differently. Shopify does tell us which items are subscriptions, 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.subscriptionExclusion

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 treated subscription items differently. Shopify does tell us which items are subscriptions, but our checkout query is already at Shopify's cost limit, so we cannot ask for it today.

Formas de Script relacionadas

Scoped to a tag or vendor

A discount limited to products carrying one tag, vendor or type.

Exclude sale items

Already-marked-down products protected from a second discount.

Exclude gift cards

Gift cards left out of a discount that would otherwise have hit them.

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.