Saltar al contenido
Ejemplos de Scripts

Migrating a hide payment method script

Worth noticing that the show-a-gateway examples do not add anything: they delete everything that does not match. Show and hide are the same operation with the predicate flipped, and both end up in the same place.

Otra API de Shopify
Qué hacía el Script

It deleted matching payment gateways from the list checkout offered.

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

HIDDEN_GATEWAY = "Cash on Delivery"
THRESHOLD = Money.new(cents: 5000)

if Input.cart.subtotal_price < THRESHOLD
  Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway|
    payment_gateway.name == HIDDEN_GATEWAY
  end
else
  Output.payment_gateways = Input.payment_gateways
end
Qué pasa con este

This needs a different kind of Shopify app

Your Script hid, renamed, or reordered payment methods. Shopify builds that with the Payment Customization 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.paymentCustomization

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 hid, renamed, or reordered payment methods. Shopify builds that with the Payment Customization 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.

Remove products by country

Products that could not ship to the shopper’s country, quietly deleted.

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.