Don't perform cart update on search submit

If you have a search widget on the cart page which is wrapped in a div
(the default wrapper for widgets) the ajax cart would try to update on
search submit. This change ensures the search form is excluded on
`submit_click`.
This commit is contained in:
James Koster 2016-07-04 11:10:02 +01:00
parent 7c8fc856e4
commit d0865bdcc7
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ jQuery( function( $ ) {
if ( $( '.woocommerce-checkout' ).length ) {
$( document.body ).trigger( 'update_checkout' );
}
$( '.shop_table.cart' ).closest( 'form' ).replaceWith( $new_form );
$( '.shop_table.cart' ).closest( 'form' ).find( 'input[name="update_cart"]' ).prop( 'disabled', true );
@ -275,7 +275,7 @@ jQuery( function( $ ) {
this.submit_click );
$( document ).on(
'submit',
'div.woocommerce > form',
'div.woocommerce:not(.widget_product_search) > form',
this.cart_submit );
$( document ).on(
'click',

File diff suppressed because one or more lines are too long