Merge pull request #29232 from Dartui/trunk
Pass checkout submit result to triggered handler
This commit is contained in:
commit
57569c5168
|
@ -525,7 +525,7 @@ jQuery( function( $ ) {
|
|||
wc_checkout_form.detachUnloadEventsOnSubmit();
|
||||
|
||||
try {
|
||||
if ( 'success' === result.result && $form.triggerHandler( 'checkout_place_order_success' ) !== false ) {
|
||||
if ( 'success' === result.result && $form.triggerHandler( 'checkout_place_order_success', result ) !== false ) {
|
||||
if ( -1 === result.redirect.indexOf( 'https://' ) || -1 === result.redirect.indexOf( 'http://' ) ) {
|
||||
window.location = result.redirect;
|
||||
} else {
|
||||
|
|
|
@ -972,6 +972,8 @@ class WC_Checkout {
|
|||
|
||||
// Redirect to success/confirmation/payment page.
|
||||
if ( isset( $result['result'] ) && 'success' === $result['result'] ) {
|
||||
$result['order_id'] = $order_id;
|
||||
|
||||
$result = apply_filters( 'woocommerce_payment_successful_result', $result, $order_id );
|
||||
|
||||
if ( ! is_ajax() ) {
|
||||
|
|
|
@ -440,6 +440,8 @@ class WC_Form_Handler {
|
|||
|
||||
// Redirect to success/confirmation/payment page.
|
||||
if ( isset( $result['result'] ) && 'success' === $result['result'] ) {
|
||||
$result['order_id'] = $order_id;
|
||||
|
||||
$result = apply_filters( 'woocommerce_payment_successful_result', $result, $order_id );
|
||||
|
||||
wp_redirect( $result['redirect'] ); //phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
|
||||
|
|
Loading…
Reference in New Issue