Each time the cart, the checkout (or, in the full edition, the mini-cart) is drawn, the plugin reads the cart once, goes through your notices in order, and prints every one that applies. Three rules decide "applies".
Rule 1: every condition on a notice must be satisfied
Not the first, and not any one of them. A merchant who adds a second condition means "and" — "the cart is worth at least $50 and it is before 3pm". If any one condition is enough, adding a condition could widen who sees a notice, which is the opposite of what the word means.
In the free edition each notice has one condition, so this rule is simply "the condition must match".
Rule 2: a condition nothing understands is false
A condition type that no code answers for — one an extension once added and no longer supports, or, in the free edition, one only the full edition can judge — does not match. The notice then does not show.
The condition is kept in storage rather than deleted: deleting it would quietly widen the notice. A notice that stops appearing is something you notice at once; one that suddenly appears to everybody is something your customers notice first.
Rule 3: the free-shipping figure is your store's configuration, or nothing
The Free shipping is close but not reached condition and the {remaining} placeholder do not use a number you type. They read your store:
- WooCommerce works out which shipping zone matches the cart, with its own zone matching.
- The plugin looks for an enabled Free shipping method in that zone whose Free shipping requires… setting is A minimum order amount or A minimum order amount AND a coupon. Those are the only two that reduce to an amount.
- It measures the cart the way WooCommerce's free-shipping check does: the displayed subtotal minus coupon discounts (plus discount tax when prices are shown with tax) — or, when the method has Apply minimum order rule before coupon discount ticked, the subtotal before coupons.
- Below the minimum, the difference is
{remaining}and the condition matches. At or above it, there is no amount and the condition does not match.
A zone whose free shipping needs A valid free shipping coupon or A minimum order amount OR a coupon has no figure — a shopper could get free shipping without spending more, and telling them to spend would be wrong — so the condition never matches there. A zone with no Free shipping method at all behaves the same.
Where notices print
| Placement | Classic (shortcode) pages | Block pages |
|---|---|---|
| The cart page | woocommerce_before_cart — above the cart |
straight after the Cart block |
| The checkout | woocommerce_before_checkout_form — above the form |
straight after the Checkout block |
| The mini-cart — Full edition | woocommerce_before_mini_cart_contents |
the classic mini-cart widget only |
Each notice goes through wc_print_notice(), WooCommerce's own notice function, in the style you chose — so a theme that has styled its shop's notices has styled these too. No stylesheet or script is added.
Notices are drawn on the server when the page is built. On the block cart, which updates itself in the browser, a notice changes when the page is reloaded, not while quantities change.
Full edition: the [gatemi_cart_notices] shortcode prints the notices for a placement anywhere: [gatemi_cart_notices placement="checkout"]. Without placement it uses cart.
Worked example (full edition)
A shop dispatches same day for orders before 15:00, and offers free shipping over $60.
- Notice 1: "Order in the next few hours for same-day dispatch." — It is before this time today
15:00, style Good news, cart and checkout. - Notice 2: "Add {remaining} more for free shipping." — Free shipping is close but not reached, cart and mini-cart.
- Notice 3: "Trade prices are applied to this order." — The shopper has one of these roles
wholesale_customer, checkout.
At 10:00, a retail shopper with $45 in the cart sees notices 1 and 2 on the cart ("Add $15.00 more…"). At 16:00 they see only notice 2. A wholesale customer at checkout sees notice 3.
What is read, and when
The cart is read once per page: its subtotal, item count, product ids (each variation with its parent), the shopper's roles (guest when signed out), the store's time and the free-shipping figure. Product categories are only looked up if a notice has a category condition.
