WebToffee Smart Coupons compatibility extension for WCPOS.
This extension targets Smart Coupons for WooCommerce Coupons by WebToffee only. It intentionally uses the wcpos-webtoffee-smart-coupons slug because other plugins also use “Smart Coupons” naming.
Current compatibility layer:
- scaffolds the WCPOS extension repository and release/test structure using the existing smart-coupons extension pattern;
- detects WebToffee Smart Coupons premium store-credit support before registering integration behavior;
- remains inert for sites without WebToffee Smart Coupons, sites with only the free/basic plugin, and sites where the
store_creditcoupon type is not registered; - documents the premium-source verification still required before implementing production balance mutation, restoration, or receipt label enrichment.
Production store-credit balance handling is intentionally blocked until WebToffee premium source or a local premium installation verifies the exact hooks, metadata, lookup-table semantics, and REST/HPOS behavior.
Before implementing balance mutation, confirm and document:
- where WebToffee premium registers the
store_creditcoupon discount type; - which class/function deducts store-credit balance after checkout or order creation;
- which metadata stores current and original balance;
- whether coupon amount represents current remaining balance;
- how
wt_sc_coupon_lookup.amountis updated; - whether REST-created WCPOS orders trigger native WebToffee deduction and restoration hooks;
- whether wallet coupons (
is_wt_gc_wallet_coupon) differ from gift/store-credit coupons.
Record findings in docs/webtoffee-premium-verification.md before enabling production behavior.
composer install
pnpm install
pnpm exec wp-env start
pnpm testPHP/WordPress tests should run through Docker/wp-env.