Stackless for WooCommerce
Checkout layouts, subscriptions, quotes and licensing for WooCommerce, in one plugin.
A buyer clicks Buy on your sales page and lands somewhere else: the checkout page, wrapped in your theme’s header, menu and footer. The page they were reading is gone, and every link on the new one is a way out.
Modal Checkout opens your checkout in a window on top of the page they’re on, so they pay without leaving it. Any button or link can open it, and each one can limit the payment methods it offers.
Add the class stackless-modal-checkout to a button or link. In the block editor it goes in Advanced → Additional CSS class(es), and in page builders in the CSS classes field. The class also works on a block that wraps the button.
Or end a link with #stackless-checkout. What the modal checks out depends on what was clicked:
#stackless-checkout=34 checks out product or variation 34. A page address that ends with it opens the checkout as soon as the page loads, which suits email and ad links.?stackless-buy=34, checks out that product. Signed links and links with several products work as normal Buy Links.Add stackless-no-modal to keep a button out. Clicks with Ctrl, Cmd, Shift or Alt held open the link as usual.
Two settings turn the modal on across the store. Both are off by default:
Add a payment method class next to the modal class to offer only that method, for example stackless-modal-checkout pay-via-bacs. Add two classes to offer both. Without one, every payment method shows.
Each class is pay-via- plus the payment method’s id. The Classes table under Payment method classes lists every method with its id, its class and a Copy button. For the Stackless gateways:
| Payment method | Class |
|---|---|
| Stripe (Stackless) | pay-via-stripe_gateway |
| PayPal (Stackless) | pay-via-stackless_paypal |
| Polar (Stackless) | pay-via-stackless_polar |
| Paddle (Stackless) | pay-via-stackless_paddle |
| Dodo Payments (Stackless) | pay-via-stackless_dodo |
pay-via-stripe-gateway works too.polar for pay-via-polar. It can be up to 40 characters, and the id keeps working. A name another method already uses, or another method’s id, isn’t saved.pay-via-stackless_polar_copy2 pays into that account only. pay-via-stackless_polar means the original, not its copies.The limit is enforced on the server, not only in the browser. Both checkouts hide the other methods, and an order placed with one of them is refused with “This payment method is not offered for this purchase. Choose one of the payment methods shown.”
After Place order, the whole page moves to the receipt or the payment page, not just the modal. Hosted payment pages, such as PayPal’s approval page or Polar’s checkout, open in the full window.
A product checkout runs on its own cart, so the visitor’s store cart stays as it was, receipt included. A checkout link pays for the store cart itself.
Closing the modal never loses the order. Opening the same checkout again brings back the cart and what the buyer entered. A checkout-link modal reloads each time, since the cart may have changed.
?coupon= code from the page address. A ?coupon= in the clicked link wins.data-stackless-product (a product or variation id), data-stackless-quantity and data-stackless-coupon set what it checks out. A data-stackless-modal-checkout attribute works like the class.stacklessModalCheckoutApi.open(34, 1, 'CODE', ['bacs']) opens a checkout from your own script. openCart() and close() are there too.stackless:modal-checkout event fires on the document for open, ready, error, close and complete. When the page has a dataLayer, it also gets a stackless_modal_checkout event.stackless_modal_checkout_enabled filter turns the modal off on a page, and stackless_modal_checkout_config filters its settings.Still stuck? Open a support ticket