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 admitidoIt skipped any line that had been added on a selling plan.
Pégalo en Rescate de scripts y mira qué reconstruye
- Copia el Ruby con el botón que hay junto a cualquier Script de esta página.
- En tu panel de Shopify, abre Stackable, luego Herramientas y luego Rescate de scripts.
- 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 admitidoDISCOUNT_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.cartWe 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
A discount limited to products carrying one tag, vendor or type.
Already-marked-down products protected from a second discount.
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.