Migrating a free shipping for certain products script
There is a single word in this template that changes the offer completely. After discounting the first paid rate it breaks out of the loop, so every other rate stays full price. A reader who skims the loop makes them all free.
Noch nicht möglichIt made the first paid delivery rate free when the cart contained a product carrying a particular tag.
Fügen Sie es in die Scripts-Rettung ein und sehen Sie, was daraus wird
- Kopieren Sie das Ruby mit der Schaltfläche neben jedem Script auf dieser Seite.
- Öffnen Sie im Shopify-Adminbereich Stackable, dann Tools, dann Scripts-Rettung.
- Fügen Sie es dort ein, lesen Sie, was das Tool bauen will, und vergleichen Sie das mit den Einstellungen auf dieser Seite.
Die Scripts-Rettung gehört zum Pro-Tarif. Nichts wird veröffentlicht, bevor Sie angeben, was Ihr altes Script berechnet hat, und beide Zahlen auf den Cent genau übereinstimmen.
Das Script
Noch nicht möglichFREE_TAG = 'freeship'
if Input.cart.shipping_address.country_code == 'US' && Input.cart.line_items.any? { |item| item.variant.product.tags.include? FREE_TAG }
Input.shipping_rates.each do |shipping_rate|
next if shipping_rate.price == Money.zero
shipping_rate.apply_discount(shipping_rate.price, message: "Free Shipping!")
break
end
end
Output.shipping_rates = Input.shipping_ratesWe have not built this yet
Your Script decided free shipping from what was in the cart. Our free shipping is decided by what the cart is worth.
Das ist unsere Lücke, nicht die von Shopify. Shopify erlaubt es, und wir haben es nicht gebaut. Es gibt hier also nichts zu verlinken und nichts, was man der Plattform anlasten könnte.
Grundschlüssel: unsupported.shippingProductCondition
Hier gibt es keinen Warenkorb zum Testen, weil nichts gebaut wird. Das Einfügen erzeugt die obige Meldung und überhaupt keine Kampagne.
Häufige Fragen
- Will Stackable rebuild this script?
- No, and the reason is stated rather than hidden: Your Script decided free shipping from what was in the cart. Our free shipping is decided by what the cart is worth.
Verwandte Script-Formen
A share taken off every delivery rate at checkout.
A flat sum off the delivery charge, floored at free.
Every delivery rate rewritten to one price rather than reduced by an amount.
Fügen Sie Ihr Script ein und sehen Sie den Nachbau
Der Nachbau wird mit dem Betrag abgeglichen, den Ihr altes Script berechnet hat, bevor Sie ihn veröffentlichen können.