PlandalfDocsSign inStart free trial

Checkouts

Buy buttons

A buy button opens your checkout over the page the buyer is on. This page covers how the checkout opens and the options you can set on the button.

Get the snippet

In the editor, open Share and choose On your site. Under How it opens, pick Trigger button, then choose a frame. The Install section below gives you the script and the button for your platform, with your checkout's slug filled in.

The Share view with On your site selected, How it opens set to Trigger button and Centred box, and a live preview
Choose how the checkout opens on your site.

Add the script once to every page that sells something, then put the button where you want it:

<button data-plandalf-present="YOUR-CHECKOUT">Buy Now</button>

Any element works as the button: a <button>, a link or an image. Plandalf opens the checkout when it's clicked. Buttons your site adds after the page loads work too. For step-by-step instructions for your site builder, see Add Plandalf to your site.

How it opens

The Frame choice sets data-plandalf-frame on the button:

On the Share screenValueWhat the buyer sees
Centred boxmodalThe checkout in a box over your page, which stays visible behind it. The default.
Side panelslideoutA panel that slides in from the side.
Bottom sheetbottomA sheet that slides up from the bottom. Good on phones.
Full overlayfullscreenThe checkout fills the window.
<button data-plandalf-present="YOUR-CHECKOUT" data-plandalf-frame="slideout">Buy Now</button>

Sizes

data-plandalf-size sets the width of a centred box or side panel:

ValueCentred boxSide panel
compact700px480px
standard1050px (the default)700px
wide1400px1400px
fullscreenFills the windowFills the window

A side panel with no size is 500px wide. On the Share screen, Width appears when you pick Side panel.

Show the checkout in the page

Choose Inline embedded instead of Trigger button to render the checkout inside your page, with no overlay. It suits a page that's only for checking out. Put this where the checkout should go, and size it with your own CSS:

<div data-plandalf-mount="YOUR-CHECKOUT" style="min-height: 480px"></div>

All button attributes

AttributeValuesWhat it does
data-plandalf-framemodal slideout bottom fullscreen embeddedHow a data-plandalf-present element opens its offer: in a modal, a side slideout, a bottom sheet or full screen on click, or embedded to render it inline in the element on page load. Default modal.
data-plandalf-initializedSet to "true" by the SDK once it has bound a present/mount element, so later scans skip it. Canonical attributes: <button data-plandalf-present="<offer>">Buy</button> → click trigger <div data-plandalf-mount="<offer>"></div> → inline mount <div data-plandalf-promo="<promo>"></div> → live countdown / promo widget data-plandalf-apply-promo="<promo>" → on a present/mount, apply tier pricing Deprecated (still scanned for one release, with a console warning): data-plandalf-mount="checkout"+template → use data-plandalf-mount="<offer>"
data-plandalf-modetest live previewEnvironment for the checkout a present/mount element opens, passed as mode. With test, the checkout runs in test mode on the organization's test domains, for people signed in to the organization, with an identify() token carrying "mode": "test", or from a signed test link; anywhere else it runs live. Test mode also needs the organization's Stripe test account. preview is for the dashboard editor; on a page it runs live.
data-plandalf-mountOffer slug. The SDK renders that offer inline inside the element when the page loads.
data-plandalf-presentOffer slug. Clicking the element opens that offer (see data-plandalf-frame).
data-plandalf-sizecompact standard wide fullscreenModal size preset for a data-plandalf-present element. Default standard.
data-plandalf-templateDeprecated. Offer slug read when data-plandalf-mount is the old kind token checkout, portal or widget; put the offer slug in data-plandalf-mount instead.
data-plandalf-test-bannerSet by the SDK on the "test mode" strip it draws above a checkout that uses test payments.

To open a checkout from your own JavaScript, see Open a checkout from code.

The styled buy button

If you'd rather not style a button yourself, the script also gives you <plandalf-buy-btn>. It opens the checkout like any other buy button, and its styles are kept apart from your page's CSS.

<plandalf-buy-btn offer="YOUR-CHECKOUT" variant="pill" size="lg" color="#1D4ED8">Buy now</plandalf-buy-btn>
AttributeValuesWhat it does
offerYour checkout's slugRequired. The checkout to open.
variantsolid (default), outline, pill, brandThe button's style.
sizesm, md (default), lgThe button's height: 32px, 40px or 52px.
colorAny CSS colour, default #0a0a0aThe accent colour.
labelTextThe button text. Without it, the text inside the tag is used, then "Buy now".
framemodal, slideout, bottom, fullscreenHow the checkout opens.
frame-sizecompact, standard, wide, fullscreenThe checkout's size.
modetest, liveAsks for a test or live checkout, like mode in code. See Test mode.
disabledTurns the button off.

While the checkout is open, the button shows a spinner and can't be clicked again. If your code changes variant, size, color, label or disabled, the SDK redraws the button straight away; offer, frame and mode are read when it's clicked. To restyle it from your own CSS, use plandalf-buy-btn::part(button).