Saltar al contenido
Ejemplos de Scripts

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.

Otra API de Shopify
Qué hacía el Script

It deleted lines from certain vendors when the cart was shipping to a listed country.

Pruébalo en tu propia tienda

Pégalo en Rescate de scripts y mira qué reconstruye

  1. Copia el Ruby con el botón que hay junto a cualquier Script de esta página.
  2. En tu panel de Shopify, abre Stackable, luego Herramientas y luego Rescate de scripts.
  3. 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

Otra API de Shopify
El Ruby original

RESTRICTED_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.cart
Qué pasa con este

This 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.

Esta parte de un Script no es un descuento. Shopify lo construye con otro tipo de función, indicado arriba, que Stackable no ofrece.

Lee la documentación de Shopify

Clave del motivo: otherApi.cartCheckoutValidation

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 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.

Formas de Script relacionadas

Purchase quantity limit

A cap on how many units a shopper could buy, enforced by trimming the cart.

Hide a payment method

A payment option taken off checkout under a condition.

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.

Usamos cookies esenciales para el funcionamiento de este sitio y, solo con tu permiso, cookies analíticas para entender el tráfico. Lee nuestra Política de cookies.