1994 / gift-vouchers-statamic
Gift vouchers for Cargo: sell vouchers with fixed or chosen amounts, email them with a printable PDF, and let customers spend them at checkout with the balance carried over.
Package info
github.com/1994limited/gift-vouchers-statamic
Type:statamic-addon
pkg:composer/1994/gift-vouchers-statamic
Requires
- php: ^8.3
- dompdf/dompdf: ^3.1
- duncanmcclean/statamic-cargo: ^1.15
- statamic/cms: ^6.35.1
Requires (Dev)
- laravel/pint: ^1.20
- orchestra/testbench: ^10.0|^11.0
- phpunit/phpunit: ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Sell gift vouchers with Cargo. Shoppers choose an amount, a design and who it's for. The recipient is emailed an engraved voucher with a printable PDF, and spends it at checkout, all at once or over several orders.
Features
- Set or chosen amounts. Sell a £25 voucher, or let shoppers pick any amount between your limits, with quick choices.
- Beautiful vouchers. An engraved, banknote-style pattern in your brand colour, different on every voucher. Or upload your own artwork, or keep it plain.
- A choice of designs. Birthday, Christmas, Thank you: each with its own title, colour and engraved motif. Shoppers see a live preview of exactly what they'll send.
- Emailed, with a PDF. The recipient gets their code, your message and a printable voucher, straight away or on a date the shopper chooses.
- Spent at checkout. Vouchers come off the total after tax, like a payment. Use several on one order; whatever's left stays on the voucher. A fully covered order needs no payment.
- Safe balances. A balance can't go below zero, and the same money can't be spent twice, even in two checkouts at once. Every change is recorded.
- Refunds and cancellations. Refund the voucher part of an order back onto its vouchers. Cancelled orders get their voucher money back.
- Control Panel. Store → Gift Vouchers: balances, history, what's still owed, search, CSV, creating vouchers by hand, changing balances, and permissions.
- Your templates. Tags that work without JavaScript, partials for Cargo's prebuilt checkout, and views you can replace with your own Antlers.
- For developers. Events, a PHP API and a JSON API.
| The voucher form | The checkout | The Control Panel |
|---|---|---|
![]() |
![]() |
![]() |
The screenshots are from Paper & Ink, a made-up shop built only with the tags in the docs. Try the demo: it runs locally in a few commands, with no licence needed. See The demo shop.
Requirements
- Statamic 6.35.1 or later, with Cargo 1.15 or later.
- PHP 8.3 or later, and a database (SQLite is fine).
Installation
composer require 1994/gift-vouchers-statamic php please gift-vouchers:install
The installer adds a Gift voucher product blueprint, a tax class with no rates, and the database tables. Make a voucher product, then add the form to its template:
{{ gift_vouchers:preview }}
{{ gift_vouchers:form redirect="/basket" }}
<input type="text" name="amount" value="50">
<input type="text" name="recipient_name" placeholder="Their name">
<input type="email" name="recipient_email" placeholder="Their email">
<textarea name="message"></textarea>
<button>Add to basket</button>
{{ /gift_vouchers:form }}
Blade
{!! Statamic::tag('gift_vouchers:preview')->param('product', $id)->fetch() !!} <s:gift_vouchers:form :product="$id" redirect="/basket"> <input type="text" name="amount" value="50"> <input type="text" name="recipient_name" placeholder="Their name"> <input type="email" name="recipient_email" placeholder="Their email"> <textarea name="message"></textarea> <button>Add to basket</button> </s:gift_vouchers:form>
and a box for codes to your basket:
{{ gift_vouchers:redeem }}
<input type="text" name="code" placeholder="Gift voucher code">
<button>Apply</button>
{{ /gift_vouchers:redeem }}
Blade
<s:gift_vouchers:redeem> <input type="text" name="code" placeholder="Gift voucher code"> <button>Apply</button> </s:gift_vouchers:redeem>
Using Cargo's prebuilt checkout? Add {{ partial:gift-vouchers::cargo-checkout }}. See Cargo's prebuilt checkout.
Documentation
Everything else is in the documentation:
- Installation, voucher products and designs
- Templates, tags, Cargo's prebuilt checkout and the demo shop
- Spending vouchers, orders and refunds, emails and the Control Panel
- Configuration, events, PHP API, HTTP API and troubleshooting
Licence
Gift Vouchers is commercial software, sold through the Statamic Marketplace. Try it free on a local or development site. Each public site needs a licence. See LICENSE.md.
Support
Report bugs and ask questions through the addon's page on the Statamic Marketplace, or email hello@1994.co.uk.
Development
composer install && npm install vendor/bin/phpunit # the ledger, checkout with Cargo, refunds, tax, tags, designs, PDFs, emails, the Control Panel npm run build # the Control Panel pages



