Skip to content

v2.3.1 — Instant coupon push on save

Choose a tag to compare

@dukenukemall dukenukemall released this 09 May 08:15
· 10 commits to main since this release

v2.3.1 — Instant coupon push on save

New

  • Coupons sync to Fungies the moment you save them in WooCommerce, mirroring how products already behaved. Adding the save_post_shop_coupon hook means there is no longer any "stale window" where a customer could apply a coupon at checkout that has not yet propagated to Fungies.
    • Same code path as Sync Now (uses local _fungies_pushed_discount_id__<workspace-hash> post meta first, falls back to remote lookup by discountCode).
    • Debounced via a 5-second transient lock per coupon to absorb double-saves from the WC admin.
    • Skips autosaves and revisions silently.
    • Logs every push to the WooCommerce → Status → Logs (fungies-*.log) source.
  • Deleting a coupon clears the workspace-scoped Fungies ID meta. Re-creating a coupon with the same code creates a fresh Fungies discount instead of trying to update a deleted one.

Pairs with v2.3.0

  • v2.3.0 forwards the applied coupon code to the Fungies hosted checkout.
  • v2.3.1 guarantees the Fungies side already knows about it by the time the customer reaches checkout.

Upgrade notes

  • No DB migrations.
  • The hourly fungies_product_sync_cron and the manual "Sync Now" button still exist as safety nets and now mostly result in 0 created, 0 updated for coupons since the instant push keeps things in sync.
  • If the Fungies API is unreachable during a coupon save, the save still succeeds in WooCommerce; the next Sync Now or cron run will catch up.