=== Better Usability for WooCommerce ===
Contributors: moiseh
Tags: woocommerce, usability, ux, ajax, checkout
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 1.0.60
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Improve WooCommerce UX with AJAX cart updates, quantity buttons, streamlined checkout, and more — for a faster, smoother buying experience.

== Description ==

Better Usability for WooCommerce removes the small but persistent friction points that cause shoppers to abandon: waiting for full page reloads, hunting for quantity controls, and navigating an unnecessary cart step before checkout. It covers four areas — Shop, Product, Cart, and Checkout — with settings you can mix and match to fit your store.

[youtube https://www.youtube.com/watch?v=y58P4h3kklw]
**Free features:**

*Cart*

* Auto-refresh cart totals via AJAX when quantity changes — no "Update cart" click required
* Show −/+ buttons around the quantity field on cart, product, and shop pages
* Lock the numeric input so shoppers can only use the +/− buttons (prevents accidental typing)
* Show a confirmation prompt before quantity is reduced to zero
* Show item quantity as a dropdown select instead of a numeric input
* Hide quantity inputs on the Cart page

*Shop*

* Change product quantity directly on the shop/archive page before adding to cart
* AJAX "Add to cart" on individual product pages (same as the shop-loop behaviour)
* Skip the cart page and go straight to checkout after adding a product
* Override the number of products per row
* Hide the default sorting dropdown
* Hide the Add to Cart button entirely (useful for catalogue-only stores)
* Customise the "Add to cart" and "View cart" button labels

*Product*

* Show item quantity as a dropdown select
* Hide price ranges on variable or grouped products
* Hide the quantity input on single product pages

*Checkout*

* Allow shoppers to delete items directly from the checkout page
* Allow shoppers to change quantities from the checkout page
* Display the unit price next to each product name

*General*

* Convert simple-product "Add to Cart" buttons to AJAX site-wide
* Hide the "Added to cart" notice after adding a product
* Hide the "View cart" link after adding a product
* Set a global maximum quantity per product
* Decimal quantity support for +/− buttons

**PRO features:**

* **Sticky Add to Cart bar** — a floating bar slides in when the shopper scrolls past the Add to Cart button, keeping purchase intent alive without hunting for the button
* **Quick View modal** — shoppers open a full product preview in a lightbox (image, price, description, Add to Cart) without leaving the Shop page
* Synchronize cart quantities automatically when changed ([view demo](https://youtu.be/Xqv8rZ-hoOk))
* Auto-update price on Product and Shop pages as quantity changes ([view demo](https://youtu.be/ZKYJZAUXV_g))
* Change product variations directly on the Shop page — fewer clicks to buy ([view demo](https://youtu.be/NhJewWjX-I8))
* Sync the MiniCart widget live from Shop or Product pages ([view demo](https://youtu.be/r7XQtkPV7sg))
* AJAX delete on the checkout page — no full page reload ([view demo](https://youtu.be/KYkqoqfsi3U))
* Change quantities inside the Mini-Cart widget ([view demo](https://youtu.be/8GDpWQhcfyU))

Get the PRO version [here](https://gum.co/wbupro).

[youtube https://www.youtube.com/watch?v=xo7SuICt9BM]

== Installation ==

1. Upload `woo-better-usability.zip` to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. It's done. Now you can go to the Settings to customize what you want

== Screenshots ==

1. AJAX Add to Cart with quantity selector on the Shop page
2. Cart settings — AJAX auto-update, +/− buttons, select dropdown, confirmation prompt
3. Product page settings — quantity select, price range visibility, quantity input visibility
4. Shop settings — products per row, quantity controls, Go to Checkout shortcut

== Changelog ==

= 1.0.60 =
* Fixed the "Better Usability for WooCommerce may not be compatible with the Checkout block" admin notice — the plugin now declares compatibility with the Cart/Checkout Blocks (its features no-op inside the Blocks rather than breaking them)

= 1.0.59 =
* PRO: Added Sticky Add to Cart bar — floats in when the shopper scrolls past the Add to Cart button on product pages; position, background colour, and text colour are all configurable
* PRO: Added Quick View modal — opens a product preview lightbox from the Shop page without a page navigation

= 1.0.58 =
* Fixed quantity selector always sending 1 when using the [add_to_cart] shortcode — add-to-cart button is a sibling of the qty form, not a child, so data-quantity was never updated
* Fixed compat scripts reporting missing dependencies by moving enqueue hook to a later priority so third-party scripts are registered first
* Fixed checkout slowdown caused by Ajax Search compat script binding an expensive DOMSubtreeModified listener — replaced with MutationObserver and excluded the script from checkout pages

= 1.0.57 =
* Declared the GPLv2 license in the plugin header
* Fixed the Author URI
* Hardened the AJAX cart and checkout handlers with nonce verification and input sanitization
* Escaped all dynamic output and corrected the text domain on every translatable string

= 1.0.56 =
* Tested with WordPress 7.0 and WooCommerce 10.8
* Declared Cart & Checkout Blocks compatibility status (features target the classic Cart/Checkout)
* Added `Requires PHP` and `Requires Plugins` headers
* Fixed a fatal error on the frontend when checking for the WooCommerce Min/Max Quantities plugin
* Added missing `exit` after dismissing an admin notice redirect

= 1.0.55 =
* Added `High-Performance order storage` compatibility

= 1.0.54 =
* Tested with WooCommerce 7.0.1 and WordPress 6.1

= 1.0.53 =
* Changed the shop quantity area and Add to cart button to be more template-standard

= 1.0.52 =
* Fixed buttons and shop quantity issues for Flatsome theme

= 1.0.51 =
* Adding better quantity buttons compatibility with ShopEngine + Elementor
* Tested with WordPress 5.9 and WooCommerce 6.2.0

= 1.0.50 =
* Reducing the templating overrides to make the AJAX add to cart features
* Increasing compatibility with WooCommerce and plugins
* Changed default plus and minus buttons looking
* Tested with WC 5.8.1

= 1.0.49 =
* Added a span with named class product_name to product title at checkout page
* Fixed block and unblock effect functions to avoid edge cases errors
* Tested with WC 5.5.1 and WP 5.8

= 1.0.48 =
* Fixed WooCommerce 5.2 checkout quantity and remove button incompatibilities
* Adding `wbu_ajax_add_to_cart_legacy` filter to use AJAX Add to cart buttons in more compatible way

= 1.0.47 =
* Added single_add_to_cart_button class for Add cart buttons in Shop
* Added BlockUI loading effect on Checkout table when changing quantity
* Allow to reduce quantity with minus button when preloaded exceeding the max limit
* Improved quantity buttons support
* Updated Tested up to tag

= 1.0.46 =
* When product is sold individually, disable quantity buttons in single product page
* Fixed some WooCommerce frontend event listeners

= 1.0.45 =
* Using document instead document.body listeners that was causing issues with some themes
* Fix incorrect translation domain for specific config
* Compatibility with Saasland theme buttons
* Define more global quantity event listener for different cart theme layouts
* Fixed missing hook call to display -/+ buttons in single product page when using selects
* Added option: Display quantity buttons everywhere, simplified buttons display config

= 1.0.44 =
* Cleaning unused source code
* Changed plus and minus buttons display to be more standard (using woo *_quantity_input_field hooks)
* Removing `Fix layout break when Enter key is pressed` config to use `wbu_fix_cart_enter_key` filter instead

= 1.0.43 =
* Fixing bug in lib that was displaying unwanted admin notices
* Updated WooCommerce tested tag

= 1.0.42 =
* Fixed text domain to allow plugin string translation
* Reduced and removed unnecessary frontend variables to reduce page size load
* Removing minified asset wbulite.min.js for better coding standards and debug

= 1.0.41 =
* Fixed flatsome duplicating add to cart section issue in shop page
* Updated WooCommerce and WordPress tested tag

= 1.0.40 =
* Removing deprecated PHP short_open_tag blocks
* Supporting for decimal quantity increment and decrement buttons

= 1.0.39 =
* Optimized Hide View cart link after add product config to not blink after add
* Added per product limit compatibility with BeRocket Min and Max Quantity for WooCommerce plugin

= 1.0.38 =
* Reversed changelog ordering to make it more standard
* Changed plugin notices to respect the guidelines
* Standardization of custom plugin templates overriding in theme
* Added filter wbu_bypass_shop_quantity_override to avoid templae override quantity html area in Shop
* Fixed View cart link after add product option to work with Greenmart theme

= 1.0.37 =
* Added custom theme template overriding similar to WooCommerce
* Removed listener for minus and plus buttons because it causing trouble with many themes

= 1.0.36 =
* Fixed Divi theme child compatibility in increase/decrease buttons
* Fixed Porto theme issues with duplicated quantity buttons
* Prevent page reload in specific cases after change quantity in shop
* Added listener for minus and plus buttons used in most themes
* Compatibility with BeRocket Ajax Products Filter plugin
* Avoid double quantity increment when using Astra theme
* Refresh minicart totals when change quantity in checkout

= 1.0.35 =
* Fixed divi theme child quantity on shop display
* Added wp 5.4 tested up to tag
* The option to transform Add to Cart into AJAX in Product is now generic for all pages

= 1.0.34 =
* Added compatibility support with WooCommerce 4.0.1

= 1.0.33 =
* Respect max stock quantities when using select input for quantities
* Fixed bug that not displaying select input in Cart in some conditions

= 1.0.32 =
* Fixed checkout max input quantity validation

= 1.0.31 =
* Added compatibility support with WooCommerce 3.8.1
* Fixed Undefined Index error in Shop page

= 1.0.30 =
* Added support for modified remove link zero quantity check
* Added support for Woo Gutenberg Products Block plugin

= 1.0.29 =
* Updated `WC tested up to` tag

= 1.0.28 =
* Removing -/+ buttons when product is sold individually

= 1.0.27 =
* Fixed blockUI to hide when finish Custom AJAX callback
* Added AJAX timeout for quantity change refresh
* Updated `WC tested up to` tag

= 1.0.26 =
* Changed the cart overlay behavior in Custom AJAX mode to use the default of WooCommerce

= 1.0.25 =
* Fix and optimize some mess in JS code and removing loops
* Fix issue in Related products not showing quantity input for first product

= 1.0.24 =
* Enqueue assets in all pages for better compatibility with custom pages
* Reduced `is shop loop` detection checks to better compatibility with Elementor and relateds
* Added overlay when AJAX refreshing cart using `Run Custom AJAX` method
* Removed option `Don't apply this option to front page` (use `wbu_enable_quantity_input` filter instead)
* Removed option `Always enqueue assets for better compatibility`
* Removed option `Optimize to make Cart work better when embebed in other pages`

== Frequently Asked Questions ==

= Does it work with my theme? =

The plugin hooks into standard WooCommerce actions and filters, so it works with the vast majority of themes out of the box. It has been specifically tested and patched for popular themes including Astra, Divi, Flatsome, Porto, Saasland, Enfold, and Greenmart. If you run into a visual glitch, try toggling the "Display quantity buttons everywhere" option, or open a support thread with your theme name.

= Does it work with Elementor (and other page builders)? =

Yes. Compatibility patches for Elementor (including its WooCommerce widgets and minicart) are built in and have been maintained across many releases. Divi and similar builders are also supported.

= Does it work with the new WooCommerce Cart and Checkout Blocks? =

The plugin's features target the **classic** (shortcode-based) Cart and Checkout templates. If your theme uses the WooCommerce Block Cart or Block Checkout, features that modify those pages (AJAX quantity change, delete from checkout) will not apply. The shop and product page features work regardless.

= Is it compatible with WooCommerce High-Performance Order Storage (HPOS)? =

Yes. HPOS compatibility has been declared since version 1.0.55.

= What is the difference between the free and PRO versions? =

The free version covers the core UX improvements: AJAX cart updates, +/− quantity buttons, Go-to-Checkout shortcut, and shop/product/checkout tweaks. The PRO version adds real-time cart synchronisation (quantities and prices update live), inline variation selection on the shop page, and minicart quantity controls — features that directly increase conversion on higher-traffic stores. See the [PRO page](https://gum.co/wbupro) for a full comparison.

= The AJAX cart update is not working. What should I check? =

1. Go to **WooCommerce → Better Usability → Cart** and try switching the "Technical method to update cart prices" to **Custom AJAX**.
2. Open your browser's developer console (F12) and check for JavaScript errors — a conflicting plugin or theme script is the most common cause.
3. Make sure no caching plugin is serving a stale version of the page. Purge all caches after changing settings.

== Upgrade Notice ==
