Add classes to variation button wrapper
This commit is contained in:
parent
130933badf
commit
843e540ed5
|
@ -39,6 +39,7 @@
|
|||
.on( 'hide_variation', function( event ) {
|
||||
event.preventDefault();
|
||||
$form.find( '.single_add_to_cart_button' ).removeClass( 'wc-variation-is-unavailable' ).addClass( 'disabled wc-variation-selection-needed' );
|
||||
$form.find( '.woocommerce-variation-add-to-cart' ).removeClass( 'woocommerce-variation-add-to-cart-enabled' ).addClass( 'woocommerce-variation-add-to-cart-disabled' );
|
||||
} )
|
||||
|
||||
// When the variation is revealed
|
||||
|
@ -46,8 +47,10 @@
|
|||
event.preventDefault();
|
||||
if ( purchasable ) {
|
||||
$form.find( '.single_add_to_cart_button' ).removeClass( 'disabled wc-variation-selection-needed wc-variation-is-unavailable' );
|
||||
$form.find( '.woocommerce-variation-add-to-cart' ).removeClass( 'woocommerce-variation-add-to-cart-disabled' ).addClass( 'woocommerce-variation-add-to-cart-enabled' );
|
||||
} else {
|
||||
$form.find( '.single_add_to_cart_button' ).removeClass( 'wc-variation-selection-needed' ).addClass( 'disabled wc-variation-is-unavailable' );
|
||||
$form.find( '.woocommerce-variation-add-to-cart' ).removeClass( 'woocommerce-variation-add-to-cart-enabled' ).addClass( 'woocommerce-variation-add-to-cart-disabled' );
|
||||
}
|
||||
} )
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue