Merge pull request #5793 from maxrice/fix-disappearing-checkout-notices
Only print checkout notices when not reloading the checkout
This commit is contained in:
commit
2e59b1c9ce
|
@ -669,14 +669,19 @@ class WC_Checkout {
|
||||||
// If we reached this point then there were errors
|
// If we reached this point then there were errors
|
||||||
if ( is_ajax() ) {
|
if ( is_ajax() ) {
|
||||||
|
|
||||||
|
// only print notices if not reloading the checkout, otherwise they're lost in the page reload
|
||||||
|
if ( ! isset( WC()->session->reload_checkout ) ) {
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
wc_print_notices();
|
wc_print_notices();
|
||||||
$messages = ob_get_clean();
|
$messages = ob_get_clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
echo '<!--WC_START-->' . json_encode(
|
echo '<!--WC_START-->' . json_encode(
|
||||||
array(
|
array(
|
||||||
'result' => 'failure',
|
'result' => 'failure',
|
||||||
'messages' => $messages,
|
'messages' => isset( $messages ) ? $messages : '',
|
||||||
'refresh' => isset( WC()->session->refresh_totals ) ? 'true' : 'false',
|
'refresh' => isset( WC()->session->refresh_totals ) ? 'true' : 'false',
|
||||||
'reload' => isset( WC()->session->reload_checkout ) ? 'true' : 'false'
|
'reload' => isset( WC()->session->reload_checkout ) ? 'true' : 'false'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue