Add Payhip to Weebly
Embed a button on Weebly
If you want to add a button to your Weebly site, the process is a little tricky. This is because they create an iFrame (i.e. they put everything into a box). It makes adding to cart purchases not possible, but you can still do direct purchases with the following workaround.
If you’d like to add a button to your Weebly site that links to one of your products, click on Products at the top of your admin dashboard.
Find the product that you’d like the button to link to, select Share / Embed, and then go to the Embed Button tab of the modal that appears.
Here you can preview your button, customizing its text, color, and type.
For Button Type, be sure to select "Direct Purchase" as "Add to Cart" buttons won't work on Weebly.
Once you’re done creating your button, click Get Your Embed Code. This will give you two snippets of code - the first is Javascript and the second is HTML.
Next, log into your Weebly site and go to Edit Site, which will take you to your editor.
From there, click Add Section > Embed Code.
Into the Code field, paste in the Javascript as is. When you paste in the HTML, add the attribute data-method=”fallback_window" after the Payhip URL and before the class, as shown below.
Then click Done/Publish to view your site.
You can now test out your new button - clicking on it will launch the checkout modal.