| 开发者 | moiseh |
|---|---|
| 更新时间 | 2026年11月12日 21:13 |
| PHP版本: | 5.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[woocommerce_cart] shortcode most stores and classic themes use), totals are recalculated with AJAX as soon as a quantity changes — no "Update cart" click — with -/+ buttons around the quantity.Add to cart button to perform with AJAX, without full page reload view demowoocommerce-ajax-cart.zip to the /wp-content/plugins/ directoryYes, with WordPress hooks (filters and actions) and JavaScript events, in a child theme's functions.php or a small plugin:
wac_side_cart_enabled (filter, bool $enabled): the side cart and its floating button on or off on the current page.wac_side_cart_before_items / wac_side_cart_after_items (actions): print your own HTML in the side cart, above or below its items.wac_free_shipping_threshold (filter, float $threshold): the order amount that gives free shipping, as the bars show it — for example converted to the shopper's currency; 0 hides the bar.wac_progress_bar_html (filter, string $html): the free shipping bar printed in the side cart, Mini-Cart and classic Cart.wac_free_shipping_block_enabled (filter, bool $enabled): whether the Cart block gets the free shipping bar.wac_quantity_div (filter: $html, $cart_item_key, $cart_item, $original_html): a cart item's quantity field with its -/+ buttons.wac_button_link (filter: $html, $label, $identifier — sub or inc): the HTML of a - or + button.wac_template_file (filter: $located, $template_name, $args): the quantity dropdown template ("Show item quantity as select").wac_frontend_vars (filter, array $vars): the settings and texts the cart script reads.mh_wac_settings (filter, array $settings): the settings, with their defaults.wac_before_cart_update (JavaScript event on document.body, with the quantity field): just before a changed quantity updates the classic cart.wac_side_cart_enabled (the side cart on or off on a page), wac_free_shipping_threshold (the free shipping amount, for example in the shopper's currency), more arguments on wac_quantity_div and wac_button_link, and the JavaScript event wac_before_cart_update; every hook is listed in the FAQ (2026-11-03)$.trim() (jQuery 3.5) replaced, and the Cart block's bars read the cart's totals through one shared script (2026-11-03)High-Performance order storage compatibilityuse strict mode on frontend script, removing unused codewp_enqueue_scripts