Linking from a static product page to a payment page

Good day all, apologies if this is posted in the wrong category.

I am wanting to use Hugo to create a static site for a group of products. On the single product page, I would like a “buy” button that links to a payment page that’s written in PHP. Ideally clicking on the buy button would link to a page loads the product ID.

Now on the whole I know it’s doable. My questions are though…

It there a special or unique way I can inject a little php into the code?


You do not give us a lot of info but assuming the link for the buy button look something like this.

I would add the product id to the frontmatter or each product post and use that to build a link for each product.

Nope. Nothing special or unique. Go for it! :slight_smile:

Hi Shello,
You haven’t been very specific with details, but it might be worth a look at Trolley, a payments front end that’s designed for static sites.
There are a few articles in the blog and docs that will help you out, but check this one out in particular that describes using Hugo with Trolley + Stripe.

(Disclosure: I’m the author of Trolley)