WC_Checkout::send_ajax_failure_response() protected WC 1.0
If checkout failed during an AJAX call, send failure response.
{} Это метод класса: WC_Checkout{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->send_ajax_failure_response();
Код WC_Checkout::send_ajax_failure_response() WC Checkout::send ajax failure response WC 5.0.0
protected function send_ajax_failure_response() {
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 ) ) {
$messages = wc_print_notices( true );
}
$response = array(
'result' => 'failure',
'messages' => isset( $messages ) ? $messages : '',
'refresh' => isset( WC()->session->refresh_totals ),
'reload' => isset( WC()->session->reload_checkout ),
);
unset( WC()->session->refresh_totals, WC()->session->reload_checkout );
wp_send_json( $response );
}
}