WooCommerce | Customize add-to-cart-variation.js
-
I want to customize add-to-cart-variation.js for WooCommerce 2.1.5, but I’m having trouble understanding what “woocommerce_variation_select_change” refers to in this section of code:
.on( ‘change’, ‘.variations select’, function( event ) {
…
$variation_form
.trigger( ‘woocommerce_variation_select_change’ )
.trigger( ‘check_variations’, [ ”, false ] );It reads as if “woocommerce_variation_select_change” is a jQuery event type, but I’ve searched through a bunch of WooCommerce .js and .php files (add-to-cart.js, add-to-cart-variation.js, single-product.js, woocommerce.js, wc-cart-functions.php, wc-core-functions.php, wc-product-functions.php, class-wc-cart.php, and class-wc-ajax.php) and I can’t find it being defined as an event, or any reference to it whatsoever – so, I have no idea what code is being run with the .trigger.
The same holds true for the second .trigger, “check_variations”, but at least I see it referenced later in add-to-cart-variation.js, so I know what code is being run.
Is there something I’m missing in the way WooCommerce defines and uses event types?
Thanks.
- The topic ‘WooCommerce | Customize add-to-cart-variation.js’ is closed to new replies.