How can I redirect a user to a custom URL after he submits the edit address form? For example I want to redirect the user to his account (my-account) instead of my-account/edit-address.
Thank you in advance!
How can I redirect a user to a custom URL after he submits the edit address form? For example I want to redirect the user to his account (my-account) instead of my-account/edit-address.
Thank you in advance!
Add this code in you function.php file
function action_woocommerce_customer_save_address( $user_id, $load_address ) {
wp_safe_redirect(wc_get_page_permalink('myaccount'));
exit;
};
add_action( 'woocommerce_customer_save_address', 'action_woocommerce_customer_save_address', 99, 2 );
woocommerce_customer_save_address
action hook – Ankur Bhadania Jul 3 '17 at 8:22