Auto Update Cart for WooCommerce allows the cart to automatically update when quantities are changed. There is only one setting for this plugin, which allows you to set a delay between when a customer updates their cart and when the cart is actually updated.
The settings page for this plugin can be found on WooCommerce > Settings > Advanced tab > Auto update cart.
Setting an Auto Update Delay
↑ Back to top
The delay setting is the number of milliseconds between the last quantity update on the cart and when the cart actually gets updated.
Milliseconds are calculated by multiplying a number of seconds x 1000.
By default, this setting will use 1000 milliseconds (1 second).
The example in the screenshot shows 2500, which is equivalent to 2.5 seconds.
Why Set a Delay?
↑ Back to topBest Practices for the Delay Setting
↑ Back to topDevelopers
↑ Back to topHooks
↑ Back to topwcauc_input_trigger
filter allows you to modify the field that Auto Update Cart checks for a change on before updating the cart.
By default, this filter returns .qty
, as the default WooCommerce quantity input fields all have the class qty
. However, you may be using a plugin that modifies the quantity input fields so that they no longer are using that class. You can use this filter to return any value that will trigger the jQuery .on('change', '.your-class-here', function(){});
Usage:
add_filter( 'wcauc_input_trigger', 'wcauc_update_trigger_function' ); function wcauc_update_trigger_function( $trigger ) { return '.your-class-here'; }