| 开发者 | emtiazzahid |
|---|---|
| 更新时间 | 2026年11月26日 17:27 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
woocommerce_after_single_product hook) and the script watches the real Add to cart button.added_to_cart event, or wc-blocks_added_to_cart after the Add to Cart with Options block's add), the bar shows "Added to cart." with a View cart link.woocommerce_after_single_product, and the bar is printed there or in the footer. The bar works with both of WooCommerce's add-to-cart blocks: the default Add to Cart form block and the newer Add to Cart with Options block.form.cart, or the Add to Cart with Options block's form) and its button (.single_add_to_cart_button) on the page. If your product template uses different markup, set your own form and button selectors under Advanced.found_variation and reset_data events.hoverbuy_should_render (final say on rendering), hoverbuy_bar_parts (add, remove or reorder the bar's parts), hoverbuy_bar_settings (settings for one product's bar), hoverbuy_contexts (name => conditional callback for the pages where the bar may appear; the page's queried object must still be a product, and the default is product => is_product), hoverbuy_bar_allowed_html (tags allowed in parts), hoverbuy_capability (who can change the settings and open the preview; default manage_woocommerce).hoverbuy_after_add fires after a product added through the bar's button reaches the cart, with the cart item key, product id, quantity and variation id. It needs the product form's own request: adds that the Add to Cart with Options block sends through the Store API (its default mode) do not fire it.hoverbuy_bar_clicked event with detail.productId and detail.state (ready or choose).templates/bar.php to yourtheme/hoverbuy/bar.php to change the markup./wp-content/plugins/) and activate it.Yes, in the free version. Until the shopper chooses a variation, the bar's button reads "Choose options", scrolls back to the product form and moves the keyboard focus to the first option the shopper can pick. After a choice, the bar shows that variation's price and stock status, and its button adds the variation with the quantity in the bar. Grouped and external products work too: the bar presses their own button the same way (there is no quantity box in the bar for them).
Switch one of them off. Storefront has its own bar under Appearance → Customize → WooCommerce → Product Page → Sticky Add-To-Cart, and OceanWP has one under Appearance → Customize → WooCommerce → Single Product → Floating Bar. Both are on by default, and the Hoverbuy settings screen reminds you while they are. Flatsome and Woodmart have one in their theme options, and Hoverbuy shows a reminder for them as well. To switch Hoverbuy off instead, untick "Show the bar on product pages" under WooCommerce → Sticky Add to Cart → Display.
It works when the product template contains WooCommerce's add-to-cart form: a form.cart with a .single_add_to_cart_button button, which is the markup WooCommerce's own add-to-cart template prints, or the form of WooCommerce's Add to Cart with Options block. If your template uses other markup, enter its form and button selectors under Advanced. If neither is found on the page, the bar stays hidden rather than showing a button that would do nothing.
The bar only appears on products that have an add-to-cart form (it does not appear on an out-of-stock simple product, for example), when the Conditions and the product's own Show/Hide box allow it, and on devices that are switched on. If all of that is fine, your theme probably renders the form with other markup: set the form and button selectors under Advanced.
Yes. The bar runs no add-to-cart request of its own; the product is added through the product's own form and WooCommerce. While a cart drawer is open the bar hides, as long as the drawer adds one of the classes listed under Advanced → Cart drawer classes to the page or locks the page's scrolling while it is open, as WooCommerce's Mini-Cart block does.
The device is checked on the server from the browser's user agent and again in the browser from the screen width (phones under 768 px, tablets from 768 to 1024 px). If your page cache serves the same copy of a page to every device, the browser check still hides the bar on a device you switched off, but a page cached for a device you switched off has no bar for anyone. In that case keep all devices on, or, if your cache plugin offers one, turn on its separate cache for mobile visitors.
No. It appears on single product pages only, and its stylesheet and script are loaded only on product pages where it is shown.
No. It has no tracking, sends nothing to its author or to any other outside service, and stores only its settings and the per-product Show/Hide choice in your own database. Deleting the plugin removes both, unless you tick "Keep these settings" under Advanced.