Add error handler/debug info in checkout ajax #7176
This commit is contained in:
parent
0c84f92249
commit
0f5c6c4219
|
@ -470,6 +470,11 @@ jQuery( function( $ ) {
|
|||
$( 'form.checkout_coupon' ).find( 'input[name="coupon_code"]' ).val( '' );
|
||||
}
|
||||
},
|
||||
error: function ( jqXHR, textStatus, errorThrown ) {
|
||||
if ( wc_checkout_params.debug_mode ) {
|
||||
console.log( jqXHR.responseText );
|
||||
}
|
||||
},
|
||||
dataType: 'html'
|
||||
});
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -224,7 +224,8 @@ class WC_Frontend_Scripts {
|
|||
'remove_coupon_nonce' => wp_create_nonce( 'remove-coupon' ),
|
||||
'option_guest_checkout' => get_option( 'woocommerce_enable_guest_checkout' ),
|
||||
'checkout_url' => add_query_arg( 'action', 'woocommerce_checkout', WC()->ajax_url() ),
|
||||
'is_checkout' => is_page( wc_get_page_id( 'checkout' ) ) && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ? 1 : 0
|
||||
'is_checkout' => is_page( wc_get_page_id( 'checkout' ) ) && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ? 1 : 0,
|
||||
'debug_mode' => defined('WP_DEBUG') && WP_DEBUG
|
||||
);
|
||||
break;
|
||||
case 'wc-address-i18n' :
|
||||
|
|
Loading…
Reference in New Issue