Promotions
Vouchers, discounts and flash sales. All three are one backend module (promotions) and three admin areas. The storefront applies them at checkout and on product pages.
How this page was verified
Read on 2026-09-15 from the backend promotions module and the admin /admin/vouchers, /admin/discounts, /admin/flash-sales areas.
Vouchers
A voucher a customer enters. Kinds (voucher_types): regular, free-shipping, first-time-purchase. A voucher can be scoped by products, couriers, payment methods, and special codes — hence the child tables voucher_regular_products, voucher_free_shipping_products, voucher_free_shipping_couriers, voucher_first_time_purchase_products, voucher_couriers, voucher_payment_methods, voucher_special_codes, voucher_images.
- Backend —
vouchersresolver (list/get, payment-methods, couriers, dashboard + performance, delete per kind) andfront*:frontVouchers,frontValidateVoucherCode. Create/update with images is REST (voucherscontroller), plus seed endpoints for types / payment-methods / shipping-couriers and a special-codes Excel export. - Storefront — applied in checkout (
src/modules/shipping/components/vouchers-form.tsx,src/lib/vouchers/). - Admin —
/admin/voucherswith three add/edit pairs:add/edit-voucher,-free-shipping-voucher,-first-time-purchase-voucher. Note the folder is spelledvourchersinsrc/libandsrc/modules— cite as-is.
Discounts
A discount applied automatically (not entered by the customer). Kinds (discount_types): regular, bundle, gift, tier. Child tables: discount_regular_products, discount_bundle_products (+ bundleds), discount_gift_products (+ gifts), discount_tier_levels, discount_tier_products, and order_discounts records what was applied to an order.
- Backend —
discountsresolver (discounts,discount, dashboards, create/update/delete for regular/bundle/gift/tier) anddiscount-types. Dashboards via REST. - Storefront — tier discount shown on the PDP (
src/modules/product-details/components/product-tier-discount.tsx); discount math insrc/context/cart-context.tsx. - Admin —
/admin/discountswith add/edit pairs for regular, bundle and tier discounts.
Flash sales
A time-boxed sale on a set of products. Tables flash_sales, flash_sales_products.
- Backend —
flash-salesresolver (CRUD + dashboards) andfront*:activeFlashSale. - Storefront —
/flash-salelisting and a PDP flash-sale banner (product-detail-flash-sale-banner.tsx). - Admin —
/admin/flash-sales(add,edit).
Gotchas
- Voucher vs discount: a voucher is entered by the customer and validated (
frontValidateVoucherCode); a discount applies on its own. Do not mix them. - Create-with-image is REST. Voucher and discount create/update that carry images post multipart, not GraphQL.
order_discountsis the record of what actually applied — read it when a total looks wrong, not the discount definition alone.