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.
Autre API ShopifyIt deleted lines from certain vendors when the cart was shipping to a listed country.
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
Autre 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.
Cette partie d'un Script n'est pas une remise. Shopify la construit avec un autre type de fonction, nommé ci-dessus, que Stackable ne propose pas.
Lire la documentation de ShopifyClé du motif : otherApi.cartCheckoutValidation
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 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.
Formes de Script apparentées
A cap on how many units a shopper could buy, enforced by trimming the cart.
A payment option taken off checkout under a condition.
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.