LemonSqueezy

This provider is limited to fetching products from LemonSqueezy.
It can not do checkouts from carts with multiple items.
You can only sell a single item at once.
It can create orders in Kirby.

Checkouts

Since you can only sell one product at a time, you can either redirect your customers to the product page hosted by Lemonsqueezy or stick with the buy now feature of the Kart plugin. The latter provides a nicer user experience as it sends them to an already initiated checkout page hosted by LemonSqueezy, ready to accept the payment information.

site/templates/product.php
<?php
/** @var ProductPage $page */
$product ??= $page;

if ($product->inStock()) { ?>
    <form method="POST" action="<?= $product->buy() ?>">
        <input type="hidden" name="redirect" value="<?= $redirect ?? $page->url() ?>">
        <button type="submit" onclick="this.disabled=true;this.form.submit();">Buy now</button>
    </form>
<?php } else { ?>
    <p><mark>out of stock</mark></p>
<?php }

Using the provider

site/config/config.php
<?php

return [
   'bnomei.kart.provider' => 'lemonsqueezy',
   // other options
];

API Credentials

.env
LEMONSQUEEZY_STORE_ID=XXX
LEMONSQUEEZY_SECRET_KEY=ZZZ

Customzing the Checkout

You can use a callback to customise both the checkout process. The returned arrays from your callbacks will be merged with the defaults created by the plugin for this provider, allowing you to override those defaults. Check the relevant PHP class and the linked online documentation for the provider to learn more about the expected data structure.

<?php

return [
    'bnomei.kart.lemonsqueezy.checkout_options' => function (\Bnomei\Kart\Kart $kart) {
        // configure the checkout based on current kart instance
        // https://docs.lemonsqueezy.com/api/checkouts/create-checkout
        return [];
    },
    // other options
];
Kirby Kart is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2025 Bruno Meilick All rights reserved.