Automatically applies a selected coupon at checkout WordPress Function
What it does?
-
One control panel for promos
Pick the coupon, scope it to specific categories, toggle auto-apply at checkout, and enable front-end messages—all from a clean settings page with a live preview. -
Auto-apply at checkout
When the cart qualifies (optionally by category), the chosen coupon is applied for the customer—no typing, no friction. -
On-page promo messaging (product & shop grid)
Displays a customizable banner that can include your coupon code and a live calculated price after discount (works with simple products and uses the minimum price for variable products). -
Design your badge
Choose text, background, and border colors; set the exact message copy (with a placeholder token for the code) and preview it instantly in the admin. -
Schedule & expiry aware
-
Scheduled coupons: message stays hidden until the coupon becomes active.
-
Expired/usage-exhausted coupons: message is removed automatically.
-
Active only coupons are applied at checkout.
-
-
Category targeting
Show messages and auto-apply only for products in selected categories (or leave blank to cover all). -
Lightweight & safe
Respects WooCommerce guards to avoid double application, sanitizes inputs, uses nonces, and includes a small responsive style for mobile.
Why it’s useful?
-
Higher conversions, less friction
Shoppers don’t have to find and enter a code; they see the savings and the actual post-discount price right where they’re deciding. -
Promotion you can trust
No awkward “invalid coupon” surprises—visibility follows the coupon’s lifecycle (scheduled → active → expired/exhausted). -
Consistent UX across the store
The same promotional logic and styling appears on product pages, collection grids, and at checkout. -
Marketing agility
Launch, schedule, and restyle promotions without developer time. Scope to categories to keep offers relevant.
