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 <noreply@anthropic.com>
3.4 KiB
Nolimit Discounts
Version 1.7.0 · a WooCommerce plugin · slug woocommerce-email-discount-manager
Gives a customer a discount, and decides which shipping methods they may choose, based on the email address they check out with.
What it does
A shop puts in email patterns and says what each one is worth. At checkout the plugin looks at the customer's email, finds the most specific pattern that matches, and applies it.
Three kinds of assignment, one per email pattern:
| type | effect |
|---|---|
| Group | the customer gets a discount group's percent, on the product categories attached to that group |
| Coupon | an existing WooCommerce coupon is applied automatically |
| Custom | a flat percent off the whole cart |
Patterns can be a full address (john@example.com), a domain
(@company.com — everyone there), or a fragment (john — any address
containing it). When more than one matches, the most specific wins: exact
address, then domain, then fragment.
Shipping
A discount group can be given shipping rules, which is the half worth reading twice because it decides what a stranger sees.
A method a group is set to only is reserved for that group. Customers who match no group do not see it. Before 1.6.0 a method set up for approved company addresses stayed on the checkout for everybody, so free delivery meant for one customer could be chosen by anyone who found it — the bug that release fixed. Show is the weaker rule and reserves nothing: it offers the method to the group and leaves everyone else alone. 1.6.0 made show do both, which took ordinary methods away from strangers whenever they were listed beside a free one; 1.7.0 split them and turned every old show rule into only.
The plugin never leaves a customer with no shipping method at all. If applying the rules would empty the list, every method comes back.
What it is not
Facts that take a while to establish by reading the source, so they are written down here:
- Not a coupon engine. The Coupon assignment type applies a coupon WooCommerce already has. This plugin does not create, price or validate one.
- No public REST surface. There is a REST API, and every route requires
manage_woocommerce. Nothing is readable by an anonymous visitor. - No telemetry. Nothing is sent anywhere. The only outbound request is the update check against the release feed, and it asks for a version number.
- No block editor or shortcode. The customer-facing side is the cart and checkout calculation and nothing else.
- Data survives uninstall. There is no
uninstall.phpand no uninstall hook, so deleting the plugin leaves its five tables and its options in the database. That is deliberate — deleting a plugin by accident should not destroy a shop's discount configuration — but it means a clean removal is a manual job. See ARCHITECTURE.md.
Where the rest is
| document | what is in it |
|---|---|
| SETUP.md | installing it, and how to tell it is actually working |
| ARCHITECTURE.md | files, boot order, where data lives, what activation does |
| CONTRACT.md | every hook this plugin offers and every one it answers |
| RELEASE.md | how a release is cut, and what is checked before it is called done |
Requires WordPress 5.8+, WooCommerce 6.0+, PHP 7.4+. Tested against WordPress 7.1.2 and WooCommerce 11.1.2 on PHP 7.4, 8.3 and 8.4.