Timeout param

This commit is contained in:
Mike Jolley 2019-01-23 15:16:40 +00:00
parent 1d76102395
commit 987a24afdc
2 changed files with 6 additions and 5 deletions

View File

@ -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 ) {

View File

@ -537,6 +537,7 @@ class WC_Frontend_Scripts {
'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':