Using HTML to trigger your modal cart.

With our standard two checkouts, you simply create a standard link that points to the URL that we provide for your product.

However, if you're using the modal cart that we provide, you can build some HTML to trigger it. We provide a built-in option to customise a button, or upload your own image to trigger it.

However, in some situations you may want to use your own custom HTML to trigger it - for example, if you've already built a button or want just a link to it, or any possibility we haven't thought of!

Luckily this is easy to do and requires only very basic HTML coding.

Below in the link we've provided some examples for you to use.

Click here for an example of using a list item to trigger a checkout.

As you can see, all you need to do is add the 'data-thrivecart-account="subdomain"' parameter (replacing 'subdomain' with your own account's subdomain), and then the 'data-thrivecart-product="1"' parameter (replacing '1' with your product's ID, which can be found in the URL when you click on the product's edit, stats or embed link.

Note that you must also add the class 'thrivecart-button' to your element. You are allowed to have any other classes on there that your HTML/CSS requires, but you must have that one as well otherwise clicking it won't do anything!

Then simply include the script - which can be placed anywhere in your HTML, though we would advise placing it before the final '</body>' tag or just before the '</head>' tag. You can copy the script from the above example, or you can take it from the code that's generated by our button builder.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk