How to use checkoutpage.co overlay

סיכום מבוסס בינה מלאכותית

FrancoisD inquired about implementing checkoutpage.co’s overlay feature on Discourse, specifically wanting to embed a buy button in a topic using provided JavaScript and HTML code. pfaffman suggested creating a theme component to enable this functionality. In response, Johani developed a custom theme component available at GitHub and demonstrated its use via a Theme Creator demo. The component allows users to insert a button using a simple [wrap=checkout ...] shortcode in posts, which dynamically generates a modal-triggering button based on seller and checkout IDs. Johani requested FrancoisD to test actual purchases to confirm functionality before moving the component to the official theme category. FrancoisD later confirmed the solution worked perfectly and thanked Johani for the effort FrancoisD. He later followed up to ask if the component had been officially published as a theme FrancoisD.

I want to use the checkoutpage.co overlay like this:

https://checkoutpage.co/knowledge/sell-your-products-in-a-modal-on-your-site/

In my specific page, it says to use this code

<script type="text/javascript" src="https://checkoutpage.co/js/overlay.js" defer></script>

After, add this (I want to add it in a topic)

<button class="cp-button" data-seller="5dd5bbcd1954eb0015e6ff53" data-checkout="rencontre-dans-les-laurentides">Buy now</button>

Is it possible within Discourse?

Thanks

I believe that you’ll need to make a theme component that will allow you to add the code to a topic. Search “theme howto”

I tinkered with this a little bit and made a theme component for it because I see a lot of potential.

GitHub - hnb-ku/discourse-checkout · GitHub

When it’s installed, you’l be able to use something like this in posts and it will automatically be converted to a button.

[wrap=checkout data-seller=5aaa701149321a00145c99b9 data-checkout=ux-animation-tool-license]button text[/wrap]

When that button is clicked, it will show the modal based on the information you add like the seller id and checkout-data

I created a demo for it on theme creator

https://theme-creator.discourse.org/theme/Johani/discourse-checkout

Everything seems to be working on our side but I haven’t actually bought anything since I haven’t used checkout-page before. Can you try to actually use it @FrancoisD like to buy / sell things and report back?

Once we confirm everything is working, I’ll move this to the theme category.

I also left some comments in the code to explain how this was put together.

Sorry @Johani I was away during holidays!

It is perfect, thanks so much for your time.

Hey @Johani, did you have the time to make it as a theme? :slightly_smiling_face: