Everything is on WooCommerce → Product Badges (capability manage_woocommerce). The badges are stored as a list in the option gmbg_badges, shared by both editions. The full edition's placement settings are in gmbg_settings.
Badges
Free edition: three fixed rows. Full edition: as many rows as you add with Add a badge; Remove takes one away on save. Badges in the same corner stack in the order they are listed.
| Label | Key | Default | What it does |
|---|---|---|---|
| What it says | text |
empty | The badge's words. Plain text. A row left empty is not saved |
| It appears when | condition |
the product is on sale | When a product wears it (below) |
| Product ids, comma separated | products |
empty | For I choose…: these products (a variation follows its product) |
| Category ids, comma separated | categories |
empty | For I choose…: products in these categories or their sub-categories |
| Active — Full edition | enabled |
on | Off keeps the badge but shows it nowhere |
| Days counted as new — Full edition | days |
30 | For published recently: how many days a product counts as new (at least 1) |
| Corner — Full edition | position |
Top left | Top left, Top right, Bottom left, Bottom right |
| Shape — Full edition | shape |
Rectangle | Rectangle, Rounded, Circle |
| Background — Full edition | background |
#1e1e1e |
A hex colour. Anything that is not a colour falls back to the default |
| Text colour — Full edition | color |
#ffffff |
A hex colour |
| Starts — Full edition | starts |
empty | First day shown, YYYY-MM-DD, in your store's timezone |
| Ends — Full edition | ends |
empty | Last day shown (inclusive) |
Each badge also has an id, made from its words (so a "Sale" badge is sale). Two badges never share an id; a second "Sale" becomes sale-2.
Conditions
| It appears when | Key | Edition | Matches when |
|---|---|---|---|
| the product is on sale | sale |
Both | WooCommerce says the product is on sale |
| the product is out of stock | out_of_stock |
Both | WooCommerce says it is not in stock |
| I choose the products or categories | manual |
Both | The product, or one of its categories (or a parent category), is listed |
| the product was published recently | new |
Full | The product was first published within Days counted as new (its creation date if it was published before the plugin was installed) |
| stock is running low | low_stock |
Full | The product manages stock, is in stock, and its quantity is at or below its own low-stock amount — or, if it has none, the store's (WooCommerce → Settings → Products → Inventory) |
| the product is featured | featured |
Full | The product is marked as featured |
In the free edition
- Badges sit in one stack at the top left and use the plugin's own style.
- A badge the full edition wrote with another corner, shape, colour or schedule keeps those settings in the option but is shown the free way: top left, default style, and without its schedule.
- A badge with a condition the free edition does not offer (new, low stock, featured) matches nothing, so it is not shown.
- A badge the full edition switched off stays off.
- Badges beyond the first three are kept in the option and not shown.
Where badges appear — Full edition
Stored in gmbg_settings.
| Label | Key | Default | What it does |
|---|---|---|---|
| On the shop and category pages | on_archives |
on | Prints badges on product listings |
| On product pages | on_single |
on | Prints badges on the product page |
| Remove WooCommerce's own sale flash | hide_wc_onsale |
off | Removes WooCommerce's "Sale!" flash from listings and the product page. Turn it on if you made a sale badge of your own |
Free edition: badges always appear in both places, and WooCommerce's own sale flash is left alone.
About scheduling — Full edition
Start and end dates are read in your store's own timezone (Settings → General → Timezone). Both ends are inclusive: a badge ending on 31 March is shown on 31 March. A date that is not YYYY-MM-DD is treated as no date.
A full-page cache decides when a page is rebuilt. A scheduled badge can stay on a cached page until that page is regenerated — the cache's clock, not the plugin's.
License & updates — Full edition
Enter the GM-XXXXX-… key from your gatemi.com account and press Activate. If a check cannot reach gatemi.com, the licence state is left unchanged.
For developers — Full edition
A table of the filters the plugin applies. See the developer reference.
