Make a gift card product, sell one, spend it, and give store credit. This guide covers the product options, what buyers and recipients see, how cards are spent and returned, the owner screens, the settings, and what to check when something does not look right.
Upload demfilz-gift-cards-and-store-credit-for-woocommerce.zip under Plugins → Add New → Upload Plugin and activate it. WooCommerce must be installed and active (WooCommerce 8.8 or later, WordPress 6.2 or later, PHP 7.4 or later). The plugin creates two database tables for cards and their history and adds a Gift cards tab to My Account.
Edit a product (or add one) and tick Gift card next to Virtual and Downloadable. The product becomes virtual and not taxable when sold, because tax is charged on the goods the card later pays for. Open the Gift card tab:
| Option | What it does |
|---|---|
| Amounts | Amounts the buyer can choose, separated by commas, shown as buttons. Up to 12. |
| Own amount | Lets buyers type an amount between the lowest and highest amount (leave the highest empty for no limit). |
| Neither | The card is sold at its regular price and is worth the regular price, so a sale price sells it at a discount. |
With amount buttons or an own amount, the regular price is set to the lowest amount so the shop shows a sensible "from" price. Variable products work too: each variation's regular price is the value of its card.
The product page shows the amount buttons or the amount box, a choice between Someone else and Me, the recipient's name and email, the buyer's name and a message of up to 300 characters (links are removed). When the order is paid (or Completed, if you choose that, and always Completed for Cash on delivery) one card per item is created and the recipient gets the Gift card email with the code, the amount, the message and the expiry date. The buyer sees who each card went to, never the code. Edit the email under WooCommerce → Settings → Emails, or copy templates/emails/dgcw-gift-card.php into yourtheme/woocommerce/emails/ to override it.
| Where | How |
|---|---|
| Cart and checkout blocks | "Add a gift card" in the order summary; applied cards show as rows with Remove and the balance left. |
| Classic cart | A "Have a gift card?" box under the cart table. |
| Classic checkout | A "Have a gift card? Click here to enter your code" link above the form, like the coupon link. |
| Coupon field | A gift card code typed into the coupon field is applied as a gift card (your real coupons always win). |
| Store credit | Comes off the order automatically for logged-in customers with credit, with a "Don't use" link. |
Store credit is used first, then cards in the order applied, up to five cards. They pay for products, shipping, fees and tax. The amount is taken from the card when the order is placed. Gift cards cannot buy gift cards and coupons do not discount gift card products, unless you allow it.
| Event | What happens |
|---|---|
| Order cancelled | Gift card and store credit amounts go back automatically (to store credit if the card has since expired or been disabled). |
| Payment failed or abandoned | The amount stays reserved for the customer's retry, then goes back after the delay in Settings (60 minutes by default), and the order returns to its full total. |
| Order refunded | Refund the money as usual. Use Return to card in the order's Gift cards box to give the gift card part back. |
| Order that bought cards refunded | Its cards are disabled; refunding some cards on a line disables that many, unspent first. |
The Gift cards tab shows the unspent gift card balance, unspent store credit, cards issued and amounts spent this month, and a searchable list (active, used up, expired, disabled). Open a card to see its history, adjust the balance, change the recipient or the expiry date, resend the email, or disable it. Issue a gift card creates one by hand. The Store credit tab adds or deducts credit for a customer. Both lists export to CSV.
| Setting | What it does |
|---|---|
| Expiry | Months after issue (36 by default, 0 = never). In Australia most gift cards sold to consumers must be valid for at least 3 years. |
| Send cards when the order is | Paid (Processing or Completed), or Completed only so you can review gift card orders first. |
| Code prefix | Optional letters in front of new codes, such as XMAS. |
| Rules | Allow gift cards to pay for gift cards; allow coupons on gift card products. Both off by default. |
| Gift card field | Show it on the cart, the checkout or both. |
| Store credit | Apply it automatically; let customers move a gift card into their credit. |
| Unpaid orders | Minutes before an unpaid order gives back what it holds. |
| Balance check page | A page with [dgcw_balance], linked from the email. "Create the page for me" makes one. |
| Hook | Use |
|---|---|
dgcw_card_created, dgcw_card_debited, dgcw_card_credited | Actions after a card is created, spent or credited. |
dgcw_product_fields_after, dgcw_validate_product_fields, dgcw_cart_item_data | Add and check extra fields on the gift card product page. |
dgcw_card_args_from_item, dgcw_send_card_now | Change a card made from an order line, or hold its email for later. |
dgcw_pay_later_gateways | Payment methods whose orders wait for Completed before cards are sent. |
dgcw_limiter_ip, dgcw_min_code_length | The visitor address used for the wrong-code limit (for proxies), and the shortest custom code. |
No gift card field in the cart: the cart holds only gift cards (they cannot pay for gift cards unless you allow it), or the field is switched off for the cart in Settings.
The recipient did not get the email: check that the Gift card email is enabled under WooCommerce → Settings → Emails and that your site sends mail (an SMTP plugin helps), then use Resend email on the card. Cash on delivery orders send cards when marked Completed.
"Too many incorrect gift card codes": eight wrong codes in 15 minutes lock the field for that visitor. If your site sits behind a proxy that does not pass on the visitor's address, every shopper shares one address; set the real address with the dgcw_limiter_ip filter.
A customer says their balance is $0 after a failed payment: the amount is held for their retry. It comes back after the unpaid-order delay, or straight away if you cancel the order.
What happens if I deactivate or delete the plugin: cards and store credit stay in the database. They are only deleted if you tick "Delete all gift cards, store credit and history" in Settings before deleting the plugin.
We build and customise WooCommerce plugins for a living. If your store needs loyalty points, trade accounts or custom checkout rules, tell us what and we'll quote it.