Migrating the 20 percent off first time customers script
The clearest illustration of why a migration tool has to refuse a partial answer. The reward half is perfectly readable and the condition half is not, and rebuilding the reward alone would hand every shopper a permanent discount.
Pas encore géréIt gave a percentage off the cheapest item, but only to shoppers who had never ordered before.
Collez-le dans Sauvetage des Scripts et regardez ce qu'il reconstruit
- Copiez le Ruby avec le bouton placé à côté de chaque Script de cette page.
- Dans votre interface Shopify, ouvrez Stackable, puis Outils, puis Sauvetage des Scripts.
- Collez-le, lisez ce que l'outil annonce qu'il va construire et comparez-le aux réglages de cette page.
Sauvetage des Scripts fait partie du forfait Pro. Rien n'est publié tant que vous n'avez pas indiqué la remise de votre ancien Script et que les deux chiffres ne correspondent pas au centime près.
Le Script
Pas encore géréDISCOUNT_AMOUNT = 20
if Input.cart.line_items.size > 1 && (Input.cart.customer.nil? || Input.cart.customer.orders_count < 1)
line_item = Input.cart.line_items.sort_by { |li| li.variant.price }.first
if line_item.quantity > 1
line_item = line_item.split(take: 1)
Input.cart.line_items << line_item
end
line_item.change_line_price(
line_item.line_price * (1.0 - (DISCOUNT_AMOUNT / 100.0)),
message: "20% off for first time customers"
)
end
Output.cart = Input.cartWe 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.
C'est notre lacune, pas celle de Shopify. Shopify l'autorise et nous ne l'avons pas construit, il n'y a donc rien à lier ici ni rien à reprocher à la plateforme.
Clé du motif : unsupported.customerOrderCount
Il n'y a pas de panier à tester ici, puisque rien n'est construit. Coller ceci produit le message ci-dessus et aucune campagne.
Questions fréquentes
- 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.
Formes de Script apparentées
A discount for shoppers with no order history, or with enough of it.
A reward for customers who had spent enough over their lifetime.
A discount only tagged customers ever saw.
Collez votre Script et voyez sa reconstruction
La reconstruction est comparée au montant que facturait votre ancien Script avant que vous puissiez la publier.