From 8fde07153a270eec6f11df8e2689b68c4a1ac865 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 1 Feb 2019 14:30:42 +0000 Subject: [PATCH] Use get instead of load --- assets/js/frontend/add-to-cart.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/assets/js/frontend/add-to-cart.js b/assets/js/frontend/add-to-cart.js index a0b2809fcaf..5b5a332c699 100644 --- a/assets/js/frontend/add-to-cart.js +++ b/assets/js/frontend/add-to-cart.js @@ -119,15 +119,13 @@ jQuery( function( $ ) { AddToCartHandler.prototype.updateCartPage = function() { var page = window.location.toString().replace( 'add-to-cart', 'added-to-cart' ); - $( '.shop_table.cart' ).load( page + ' .shop_table.cart:eq(0) > *', function() { - $( '.shop_table.cart' ).stop( true ).css( 'opacity', '1' ).unblock(); + $.get( page, function( data ) { + $( '.shop_table.cart:eq(0)' ).replaceWith( $( data ).find( '.shop_table.cart:eq(0)' ) ); + $( '.cart_totals:eq(0)' ).replaceWith( $( data ).find( '.cart_totals:eq(0)' ) ); + $( '.cart_totals, .shop_table.cart' ).stop( true ).css( 'opacity', '1' ).unblock(); $( document.body ).trigger( 'cart_page_refreshed' ); - }); - - $( '.cart_totals' ).load( page + ' .cart_totals:eq(0) > *', function() { - $( '.cart_totals' ).stop( true ).css( 'opacity', '1' ).unblock(); $( document.body ).trigger( 'cart_totals_refreshed' ); - }); + } ); }; /**