Since the code is built to use a form submit for all the quanitities
already, I just made this an ajax call instead of a whole page call.
The result is the exactly the same and the .woocommerce div is replaced
with the resulting HTML.
Adds an ajax call for applying coupons while on the cart
screen (not checkout, as it already has this.)
This is the first commit to add ajax calls to the cart update
functions. See issue #6734
If there are more variations than the threshold allows (set to 20
currently) this loads the matching variation via ajax instead of inline
in the HTML. #8477
For a more detailed explaination of why this is helpful, see
Issue #4202. In short, from a dev ops perspective, if we want to build /
concatonate our front end scripts into a single application.js file, we
need to ensure scripts first check for dependent global object helpers
before trying to use them. For example, there are several objects
(created via PHP using `wp_localize_script`) which generate objects such
as `wc_single_product_params`. These objects will not exist on most
other pages, however these scripts attempt to execute code that
references these objects.