diff --git a/assets/js/frontend/cart-fragments.js b/assets/js/frontend/cart-fragments.js index 865f353049a..4f04b77b05e 100644 --- a/assets/js/frontend/cart-fragments.js +++ b/assets/js/frontend/cart-fragments.js @@ -38,7 +38,7 @@ jQuery( function( $ ) { var $fragment_refresh = { url: wc_cart_fragments_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'get_refreshed_fragments' ), type: 'POST', - timeout: 5000, + timeout: wc_cart_fragments_params.request_timeout, success: function( data ) { if ( data && data.fragments ) { diff --git a/includes/class-wc-frontend-scripts.php b/includes/class-wc-frontend-scripts.php index b7c1e688b47..55d48e4fd65 100644 --- a/includes/class-wc-frontend-scripts.php +++ b/includes/class-wc-frontend-scripts.php @@ -533,10 +533,11 @@ class WC_Frontend_Scripts { break; case 'wc-cart-fragments': $params = array( - 'ajax_url' => WC()->ajax_url(), - 'wc_ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ), - 'cart_hash_key' => apply_filters( 'woocommerce_cart_hash_key', 'wc_cart_hash_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ), - 'fragment_name' => apply_filters( 'woocommerce_cart_fragment_name', 'wc_fragments_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ), + 'ajax_url' => WC()->ajax_url(), + 'wc_ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ), + 'cart_hash_key' => apply_filters( 'woocommerce_cart_hash_key', 'wc_cart_hash_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ), + 'fragment_name' => apply_filters( 'woocommerce_cart_fragment_name', 'wc_fragments_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ), + 'request_timeout' => 5000, ); break; case 'wc-add-to-cart':