=== Smart Product Badges for WooCommerce ===
Contributors: cartengine
Tags: woocommerce, badges, product badges, sale badge, woocommerce badges
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add product badges to WooCommerce automatically. Sale, New, Low Stock badges with smart rules. Works with block themes. Free, no coding needed.

== Description ==

**Smart Product Badges for WooCommerce** is a free, lightweight plugin that automatically displays beautiful badges on your WooCommerce products. Highlight sales, new arrivals, low stock items, and more — without touching any code.

= Why Product Badges? =

Product badges increase conversion rates by **15-25%** by drawing attention to key products. Whether it's a sale, a new arrival, or a low-stock item, badges help customers make faster buying decisions.

= Why Smart Product Badges instead of YITH? =

* YITH Badge Management has a **2.9/5 rating** — ours just works
* CSS-only rendering (no frontend JavaScript)
* Built for modern block themes from day one
* Free version has no feature locks or upgrade nags

= Key Features (Free) =

* **4 Beautiful Templates** — Sale, New, Hot, and Limited badge styles with modern gradient designs
* **4 Smart Rules** — Auto-assign badges by On Sale status, Category, price range, or publish date
* **Custom Badge Text** — Enter any text for each badge, or use the template default
* **Universal Theme Support** — Works with any WordPress theme (classic or block-based)
* **WooCommerce Blocks** — Full compatibility with the new block-based shop pages
* **Performance Optimized** — CSS-only rendering, intelligent caching, < 5ms per badge
* **Mobile Responsive** — Badges adapt beautifully to all screen sizes
* **Multilingual Ready** — Full UTF-8 support for any language
* **Unlimited Badges** — Create as many badge rules as you need

= How It Works =

1. Go to **WooCommerce → Badges**
2. Click **Add Badge**
3. Choose a template (Sale, New, Hot, or Limited)
4. Set a display rule (e.g., "On Sale", "Category", "Price under $50", or "Published in last 7 days")
5. Save — badges appear instantly on matching products!

= Automatic Badge Rules =

* **On Sale** — Show badge on products that have a sale price (discounted)
* **Category** — Badge all products in specific categories (with convenient multiselect)
* **Price** — Badge products above, below, or between price ranges
* **Publish Date** — Auto-badge new arrivals (e.g., published in last 14 days)

= Works With Popular Themes =

Tested and compatible with:

* Twenty Twenty-Three, Twenty Twenty-Four, Twenty Twenty-Five
* Astra, OceanWP, GeneratePress
* Kadence, Neve, Storefront
* Hello Elementor
* Any WooCommerce-compatible theme

= Need More Features? =

[BadgePro](https://cartengine.dev/products/badgepro/?utm_source=wporg&utm_medium=readme&utm_campaign=free) unlocks:

* **6 Badge Templates** — Sale, New, Hot, Limited, Low Stock, plus fully Custom style
* **Custom Style Designer** — Pick your own colors, gradients, shape, font size, and padding
* **7 Rule Types** — Category, tag, stock level, on sale, price, publish date, and manual assignment
* **Manual Assignment** — Choose exactly which products display which badges
* **Variable Products** — Different badges for different product variations
* **Multiple Badges** — Show up to 5 badges simultaneously on a single product, ordered by priority
* **Badge Scheduling** — Show badges only during specific date ranges
* **Dynamic Text** — Use placeholders in badge text: `{discount%}`, `{sale_price}`, `{regular_price}`, `{price}`, `{stock_qty}`
* **CSS Animations** — Add pulse, bounce, or fade-in effects to any badge
* **Priority Support** — Fast, dedicated help

[Upgrade to BadgePro →](https://cartengine.dev/products/badgepro/?utm_source=wporg&utm_medium=readme&utm_campaign=free)

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/smart-product-badges-for-woocommerce/` or install through WordPress Plugins screen
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Go to **WooCommerce → Badges** to create your first badge
4. Choose a template, set a rule, and save!

== Frequently Asked Questions ==

= Does it work with block themes? =

Yes! The plugin works perfectly with both classic and block-based themes, including WooCommerce Blocks product grids.

= Will this slow down my site? =

No. The plugin uses CSS-only rendering and intelligent transient caching. Typical badge render time is under 5ms.

= Can I use custom text on badges? =

Yes! You can enter any custom text in the Badge Text field when creating a badge. Leave it empty to use the template default (e.g., "SALE", "NEW").

= What happens when multiple badges match a product? =

The badge with the highest priority number is displayed. This prevents badge clutter while giving you full flexibility.

= Is there a Pro version? =

Yes. [BadgePro](https://cartengine.dev/products/badgepro/?utm_source=wporg&utm_medium=faq&utm_campaign=free) adds 6 badge templates, 7 rule types, manual assignment per product, badge scheduling, dynamic text placeholders ({discount%}, {stock_qty}), CSS animations, variable product support, and multiple badges per product. One-time purchase, no subscription.

= Can I upgrade to Pro later? =

Yes! Your badges and settings will carry over seamlessly when you upgrade to BadgePro.

= Is it HPOS compatible? =

Yes. The plugin is fully compatible with WooCommerce High-Performance Order Storage.

= Is it GDPR compliant? =

Yes. The plugin does not collect, store, or transmit any personal data.

= Does it work on WordPress Multisite? =

Yes. The plugin is fully compatible with WordPress Multisite installations.

== Screenshots ==

1. Badges displayed on shop page — Sale and New badges on product images
2. Badge creation interface — choose template, text, and display rules
3. Badge list in admin — manage all your badges in one place

== Changelog ==

= 1.2.1 =
* Fix fatal error in the block editor caused by calling a non-existent wp_doing_rest() function

= 1.2.0 =
* Added: Hot template (orange gradient, pill shape)
* Added: Limited template (purple gradient)
* Added: Category rule with convenient multiselect UI
* Improved: Social proof counter on badge list page
* Fixed: Admin CSS classes now use proper spbfw_ prefix
* Enhanced: Better UX for rule configuration

= 1.0.0 =
* Initial release
* 2 badge templates (Sale, New)
* 3 automatic rule types (On Sale, Price, Publish Date)
* Custom badge text support
* Universal theme compatibility
* WooCommerce Blocks support
* Performance-optimized CSS rendering
* Transient caching system

== Upgrade Notice ==

= 1.2.1 =
Fixes a fatal error that prevented editing pages/posts in the block editor.

= 1.2.0 =
More templates and category rules. Upgrade to get Hot and Limited badge styles plus category-based auto-assignment.

= 1.0.0 =
Initial release. Install to start displaying beautiful product badges on your WooCommerce store.
