Websites and builders
Shopify
Add the Plandalf script to your Shopify theme and you can sell an offer from any product page, landing page or section, beside your normal Shopify cart. It suits upsells, memberships, courses and limited-time offers that don't belong in the cart.
Shopify's own checkout pages don't run theme scripts, so Plandalf buttons live on your storefront pages. A Plandalf purchase goes through the payment account you connected to Plandalf, and it doesn't create a Shopify order.
Add the script
These are the steps your checkout's Share screen shows for Shopify. Copy the snippets from there and they already hold your script address and checkout slug.
Install the SDK
Online Store → Themes → Edit Code. Open theme.liquid and paste the script tag right before </body>.
<script async src="https://YOUR-ORG.plandalf.dev/js/plandalf-sdk.js"></script>Add the trigger button
Edit the page or section where you want the checkout. Paste the HTML directly.
<button data-plandalf-present="YOUR-CHECKOUT">Buy Now</button>Make the first open instant (optional)
Paste this under the SDK script tag on the pages that hold the trigger. It fetches the checkout UI (about 1.2 MB) in the background while the page sits idle, so the click only pays for creating the session. Leave it off pages with no checkout: visitors download it whether or not they buy. In a React app, call sdk.preload('checkout') from the ready callback in an effect instead.
<script> // Optional: fetch the checkout UI while the page is idle, so the first click opens at once. window.plandalf = window.plandalf || function () { (window.plandalf.q = window.plandalf.q || []).push(arguments); }; plandalf('ready', (sdk) => sdk.preload('checkout')); </script>
Shopify's own /checkout pages run on a separate domain and won't execute theme scripts, so Plandalf buttons live on product and landing pages.
To open the code editor, go to Online Store → Themes, click … next to your current theme and choose Edit code. Open layout/theme.liquid, paste the script just before </body> and click Save. If you switch themes later, add it to the new theme too.
Open a checkout from a button
In the theme editor (Online Store → Themes → Customize), add a Custom Liquid section or block where the button should go and paste:
<button data-plandalf-present="YOUR-CHECKOUT">Buy Now</button>
Click Save. To match your theme's buttons, add its button class, for example class="button". You can also paste the button into a page's HTML view or a product template. More options are in Buy buttons.
Show a checkout on the page
Add a Custom Liquid section where the checkout should appear and paste:
<div data-plandalf-mount="YOUR-CHECKOUT" style="min-height: 480px"></div>
The checkout fills the section. Change min-height to suit your layout.
Show a deadline timer
Add a Custom Liquid block with an empty element that has your deadline timer's slug. The script draws the live countdown inside it. To charge the deadline timer's current price, add data-plandalf-apply-promo with the same slug to your buy button.
<div data-plandalf-promo="YOUR-PROMO"></div>
<button data-plandalf-present="YOUR-CHECKOUT" data-plandalf-apply-promo="YOUR-PROMO">Buy Now</button>
See Countdowns.
Check it's working
Open your storefront
Use your
.myshopify.comaddress or your domain in a private window, not the theme editor's preview, which can lag behind saved code. In the browser console, typeplandalf: you should see a function.undefinedmeans the script isn't on the page.Click your button
The checkout opens over the page.
Make a test purchase
Add
your-store.myshopify.comin Plandalf under Settings → Advanced → Test domains while you test, and remove it before launch if buyers use that address. See Test mode.
If it isn't working
- Shopify caches theme files. Hard-refresh the storefront after you save
theme.liquid(Shift + Cmd + R on a Mac). - Check you edited the published theme, not a draft copy.
- A button on Shopify's cart or checkout pages won't work. Put it on a product, collection or landing page.
- Add
data-debug="true"to the script tag and the console logs each step the script takes.
See Troubleshooting.
