Commit Graph
4 Commits
Author SHA1 Message Date
kristianwindandClaude Opus 5.5 654d8632d2 1.8.0: a coupon can carry a group's shipping rules
CI / WordPress latest + WooCommerce latest on PHP 8.3 (pull_request) Successful in 1m11s
Compatibility / WP latest / WC latest / PHP 7.4 (pull_request) Skipped
Compatibility / WP latest / WC beta / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP nightly / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.4 (pull_request) Skipped
Compatibility / Keep the compatibility headers honest (pull_request) Skipped
CI / Static checks (pull_request) Successful in 4m26s
Shipping Rules gets a "Coupon codes" field per group. A customer with one
of those coupons in the cart gets the group's shipping methods, including
"Only" ones, whatever their email. Asked for on a live shop: free delivery
reserved for one company's addresses had to reach people using that
company's coupon too.

Only the shipping follows the coupon; the group's percentage discount
stays with its email assignments. An email assigned to a group still
wins. The shipping package key now carries the effective group, so
WooCommerce's rate cache follows a coupon being added or removed.

Stored as groups.shipping_coupons (dbDelta adds the column on update).
Smoke tests: 100 assertions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 14:07:05 +01:00
kristianwindandClaude Code 0793a1ee82 1.7.0: shipping rule "Only" reserves a method, "Show" no longer does
Since 1.6.0 "Show" both whitelisted a method for its group and hid it from
everybody else. A group shown ordinary methods next to a free one therefore
took the ordinary ones away from every stranger, who was left with only the
free method. "Only" now carries the reservation; "Show" is just the group's
whitelist. Existing show rules are converted to only once on update so the
checkout does not change until the shop chooses.

Co-Authored-By: Claude Code <[email protected]>
2026-10-02 12:28:45 +02:00
kristianwindandClaude Opus 5 6ef4ee8fe5 1.6.0: a shipping method a group is shown belongs to that group
Kristian checked out with an address in no group and was offered both free
delivery methods set up for the Netic group. Measured on the shop before
touching anything: one group, four rules, two of them "show" on the free
delivery methods he saw.

It was not a regression. A test asserted the behaviour as intended — "an
unmatched customer sees every method" — so a "show" rule was a whitelist FOR
THE GROUP and nothing more. The plugin did half of what its own description
promises: it filtered what the group sees and never reserved anything from
anyone else. On a shop that takes money the effect is that free delivery
arranged for one company is available to every customer.

A method named in any group's show rules is now reserved for the groups that
name it.

Answering "does it work for other discounts too", which found the hole the
first fix left: it did not. A group with NO rules of its own returned every
rate untouched, and so did a group carrying only "hide" rules, because neither
engages the whitelist — so their members saw another group's reserved methods.
Both now have other groups' reserved methods removed.

The "never leave the customer without shipping" guard is kept and asserted: a
shop that reserved everything it offers must still let an ordinary customer
check out, because that failure is worse than the leak.

Four assertions, each proven red. Two of them caught my own mistakes rather
than the product's: the hide-only fixture originally left nothing for the
customer, so the guard fired and returned every rate — which reads exactly like
the leak it was written to detect. A third rate makes the behaviour observable.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-22 09:46:48 +02:00
kristianwind e4a40e53a0 Initial commit: WooCommerce Email Discount Manager plugin 2026-08-23 15:38:14 +02:00