wc-coupon-dynamic
CommunityCreate virtual WooCommerce coupons on the fly.
AuthorLonsdale201
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Synthesize WooCommerce coupons at runtime without creating shop_coupon posts in wp_posts, enabling rule-based, per-code discounts that are calculated on the fly and do not require DB writes.
Core Features & Use Cases
- Dynamic coupon resolution via the woocommerce_get_shop_coupon_data filter to generate a WC_Coupon-like data array.
- No DB writes: read_manual_coupon path populates the coupon entirely from code data.
- Support for custom discount types via woocommerce_coupon_discount_types and corresponding woocommerce_coupon_get_discount_amount hooks.
- Validation hooks guide how and when virtual coupons are allowed (woocommerce_coupon_is_valid, is_valid_for_cart, is_valid_for_product).
Quick Start
Configure a filter on woocommerce_get_shop_coupon_data to return a valid discount array for a code like LOYALTY-42 and verify the cart applies the virtual coupon without creating a shop_coupon post.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: wc-coupon-dynamic Download link: https://github.com/Lonsdale201/wp-agent-skills/archive/main.zip#wc-coupon-dynamic Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.