Websites and builders
Divi
Paste the Plandalf script into Divi's Theme Options once, and any Divi button can open your checkout.
In Divi 5 you give the Button module one attribute, so the button keeps the design you gave it in Divi. A Code module holds an inline checkout, a deadline timer, or the button itself on Divi 4. You don't need a plugin.
If MemberPress controls access on your Divi site, use the MemberPress plugin. It puts your checkout on each membership page and gives buyers their membership when they pay.
Add the script
Copy the script from your checkout's Share screen (pick Divi) so it holds your own address.
Open the Integration tab
In WordPress, go to Divi → Theme Options and open the Integration tab.
Paste the script into the body code
Enable the body code and add the script to it, then save. Divi adds body code to every page of the site. In Divi 4 the fields are Enable body code and Add code to the < body >.
<script async src="https://YOUR-ORG.plandalf.dev/js/plandalf-sdk.js"></script>
If your site doesn't have Divi → Theme Options, for example because it runs the Divi Builder plugin on another theme, add the script with a code plugin as the WordPress guide shows. The button and Code module steps below stay the same.
Open a checkout from a Divi button
In Divi 5, modules have an Attributes group where you can add custom HTML attributes, so Divi's own Button module can open your checkout.
Add a Button module
Add a Button module, or open one you already have, and set its text.
Add the attribute
Open the module's Advanced tab, then Attributes, and click + Add Attribute. Choose the Target Element (Elegant Themes' guide says this is usually the Module). Type
data-plandalf-presentas the Attribute Name and your checkout's slug as the Attribute Value.Save and try it
Save the page, open the published page and click the button. Plandalf opens the checkout over the page instead of following the button's link.
data-plandalf-present = YOUR-CHECKOUT
The Share screen lists the exact attribute rows for your checkout. If you picked any frame other than the centred box, one of them is data-plandalf-frame. More options are in Buy buttons.
On Divi 4
Divi 4's Button module has no custom attributes. Add a Code module where the button goes and paste the button into its Text box:
<button data-plandalf-present="YOUR-CHECKOUT">Buy Now</button>
Show a checkout on the page
Add a Code module where the checkout should appear and paste an inline checkout into its Text box:
<div data-plandalf-mount="YOUR-CHECKOUT" style="min-height: 480px"></div>
Change min-height to suit your layout.
Show a deadline timer
In a Code module, add an empty element with your deadline timer's slug. The script draws the live countdown inside it.
<div data-plandalf-promo="YOUR-PROMO"></div>
To charge the deadline timer's current price, add data-plandalf-apply-promo with the same slug to your buy button. On a Divi 5 Button module, that's a second attribute. See Countdowns.
Check it's working
Open the published page
Use a private window. In the browser console, type
plandalf: you should see a function.undefinedmeans the script isn't on the page.Click your button
Plandalf opens the checkout over the page.
Make a test purchase
Open the Test mode link on the Share screen, or add your staging site in Plandalf under Settings → Advanced → Test domains. See Test mode.
If it isn't working
- The button does nothing: check that body code is enabled in the Integration tab and that you saved Theme Options.
- Check the attribute name is exactly
data-plandalf-presentand that its value is your checkout's slug, not the full checkout link. - If a caching or speed plugin delays or combines scripts, exclude
plandalf-sdk.jsfrom it, then purge the cache. - Add
data-debug="true"to the script tag and the console logs what the script is doing.
See Troubleshooting.