Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* visit us - https://wpgenie.org */
- /*
- Redirect to cart after log in if user added something to cart prior to log in.
- This code snippet should be pasted into your child theme functions.php file.
- */
- function custom_registration_redirect() {
- if( WC()->cart->cart_contents_count > 0){
- wp_safe_redirect( wc_get_cart_url());
- }
- }
- add_action('woocommerce_registration_redirect', 'custom_registration_redirect', 2);
- add_action('woocommerce_login_redirect', 'custom_registration_redirect', 2);
Advertisement
Add Comment
Please, Sign In to add comment