Migrating a remove products from the cart script
A restriction enforced by deletion. The behaviour that replaces it is arguably better, because it tells the shopper what happened rather than making an item vanish between the cart and checkout.
Altra API ShopifyIt deleted lines from certain vendors when the cart was shipping to a listed country.
Incollalo in Recupero Script e guarda cosa ricostruisce
- Copia il Ruby con il pulsante accanto a ogni Script di questa pagina.
- Nell'admin di Shopify apri Stackable, poi Strumenti, poi Recupero Script.
- Incollalo lì, leggi cosa dichiara di costruire lo strumento e confrontalo con le impostazioni di questa pagina.
Recupero Script è nel piano Pro. Non viene pubblicato nulla finché non dichiari quanto scontava il vecchio Script e le due cifre non coincidono al centesimo.
Lo Script
Altra API ShopifyRESTRICTED_VENDORS = ["acme", "globex"]
RESTRICTED_COUNTRIES = ["ca", "au"]
cart = Input.cart
unless cart.shipping_address.nil?
if RESTRICTED_COUNTRIES.include?(cart.shipping_address.country_code.downcase)
cart.line_items.delete_if do |line_item|
RESTRICTED_VENDORS.include?(line_item.variant.product.vendor.downcase)
end
end
end
Output.cart = Input.cartThis needs a different kind of Shopify app
Your Script blocked or limited checkout, such as a purchase limit or an age check. Shopify builds that with the Cart and Checkout Validation API, which Stackable does not ship.
Questa parte di uno Script non è uno sconto. Shopify la realizza con un altro tipo di funzione, indicato sopra, che Stackable non offre.
Leggi la documentazione di ShopifyChiave del motivo: otherApi.cartCheckoutValidation
Qui non c'è nessun carrello da testare, perché non viene creato nulla. Incollando questo compare il messaggio qui sopra e nessuna campagna.
Domande frequenti
- Will Stackable rebuild this script?
- No, and the reason is stated rather than hidden: Your Script blocked or limited checkout, such as a purchase limit or an age check. Shopify builds that with the Cart and Checkout Validation API, which Stackable does not ship.
Forme di Script correlate
A cap on how many units a shopper could buy, enforced by trimming the cart.
A payment option taken off checkout under a condition.
Incolla il tuo Script e guardalo ricostruito
La ricostruzione viene confrontata con l'importo che il tuo vecchio Script applicava, prima che tu possa pubblicarla.