Add classes to variation button wrapper

This commit is contained in:
Mike Jolley 2016-05-19 11:17:34 +01:00
parent 130933badf
commit 843e540ed5
2 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,7 @@
.on( 'hide_variation', function( event ) { .on( 'hide_variation', function( event ) {
event.preventDefault(); event.preventDefault();
$form.find( '.single_add_to_cart_button' ).removeClass( 'wc-variation-is-unavailable' ).addClass( 'disabled wc-variation-selection-needed' ); $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 // When the variation is revealed
@ -46,8 +47,10 @@
event.preventDefault(); event.preventDefault();
if ( purchasable ) { if ( purchasable ) {
$form.find( '.single_add_to_cart_button' ).removeClass( 'disabled wc-variation-selection-needed wc-variation-is-unavailable' ); $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 { } else {
$form.find( '.single_add_to_cart_button' ).removeClass( 'wc-variation-selection-needed' ).addClass( 'disabled wc-variation-is-unavailable' ); $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