The woocommerce_registration_redirect
is a filter hook, but NOT an action hook.
I’ve tried the shortcode provided in the mentioned link in your comment above and it works for me in this way:
function AS_redirection_after_registration($redirection_url) {
if($redirection_url =="first-page-slug") // $redirection_url is the slug of the current page where the shortcode is placed
return home_url('/my-page');
elseif($redirection_url=="second-page-slug")
return home_url('/my-second-page');
return home_url('/checkout/');
}
add_filter( 'woocommerce_registration_redirect', 'AS_redirection_after_registration', 10, 1 );
So the $redirection_url
parameter passed to the filter gives you the current page slug where the shortcode is placed and, basing on that, you can decide where to redirect to after registration.
Remember to always return something when using filter hooks,
Related Posts:
- Custom Redirect after registration in WooCommerce
- How to check if is in cart page? [closed]
- Remember page before login page, redirect to that page after login
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- Username field is not shown in Woocommerce’s registration contact form
- Import products to WooCommerce by CSV page won’t open [closed]
- Woocommerce Login Redirect not working [closed]
- Redirect user after login through woocommerce login page to page with his/her username?
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- Force User Registration before visitng Checkout Page
- Register a new user on wooCommerce using Rest API
- Allow WooCommerce existing customers to checkout without being logged in [closed]
- Redirect customer to login page (with other signup plugin) if user not logged in when proceeding to checkout
- Auto generate user email while registration
- Woocommerce – Want to block a user agent from accessing specific product pages
- How to – proper WordPress 301 redirects?
- Woocommerce, prevent login after registration and redirect to custom URL
- Woocommerce check if email already created order recently [closed]
- Redirect no product url’s to static url
- Block Disposable Emails on Woocommerce Registration
- Clients with empty username are not receiving request new password email
- WooCommerce get_author_posts_url() – Author URL redirecting to shop base
- Woocommerce Register Error
- Make e-Mail optional on Woocommerce sign up
- Assign user role by text field in WordPress (Woocommerce) [closed]
- Impossible to create a new WooCommerce customer using Rest API
- Registration roles
- Is it ok to 301 redirect product-category pages to custom pages?
- How to send Woocommerce Customer Details (Name, Email and Phone Number) to Admin upon signup
- WooCommerce and ACF: How to Redirect Upon Add to Cart – Partially Working Example
- wordpress site auto redirect to another site when I enable woocommerce
- Redirect After Registration on Specific Link
- Custom Registration Fields woocommerce
- mydomain.com/wp-login redirects to wordpress.com/wp-login
- WooCommerce shop, my account, cart every page redirect to home page [closed]
- Change WooCommerce registration form/way?
- DatePicker in Woocommerce (My Account) Registration [closed]
- Remove login fields from /customer-account page [closed]
- My account page, don’t show the complete “Registration form”
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- getting attributes in a product loop
- How Fragile Is DB if I Upload Completely Updated Files
- Broken 302 redirection for product subcategory (Woocommerce, Apache)
- Can I get some product is virtual in Woocommerce by hook?
- Woocommerce order_complete email dont send after changing order status via sql
- Removing storefront-sorting div from the before section of Shop page
- Site with WooCommerce section moved to HTTPS – all pages except home and main store are 404s
- syntax error – woocommerce
- Multiple quantities with options
- How to on/off woocommerce filter with redux framework [closed]
- (WooCommerce) Conflict with template – Can’t load payment methods
- Hook woocommerce price in backend order edition
- Website Tablet Check Out Field Issue
- How to change the link of product menu from wordpress admin panel
- WooCommerce order created via REST – sending the date_created along
- how to add custom reviews button in woocommerce order complete generated mail
- Click Count on Download a File
- delete cart item from the carts when user login from other system
- get_posts only getting most recent product
- How to add coupon expiry date into the followup emails?
- How to only show featured products in wooCommerce using function.php function
- How to insert link, with lightbox, that opens specific page content only
- Add youtube embed to woocommerce variations
- WooCommerce – Large number of product variations (200+)
- how can i import the csv file in wordpress woocommerce.?
- Add custom link/pop up under variations dropdown
- Problem in woocommerce.The option “Add product image” is gone.Please help me!
- some products free and some product is not free for shipping
- Remove plugin function and add it back in via functions.php
- Disable Woocommerce main shop page, but not the product category archive pages
- woocommerce – undelete posts
- deactivate product-page image slider on mobile
- Importing Attributes in to Woocommerce
- Add multiple products to woocommerce cart
- woocomerce products and categories don’t display fixed
- How to make product free for some customers and paid for others?
- Advanced Custom Fields missing Woocomerce in Rules
- Duplicate post/product permalinks. (Link is temporary)
- Add an extra column to /my-account/subscriptions/ WooCommerce page
- woocommerce: when adding or removing items to cart , it takes cart a few seconds to read changes?
- Update Custom Post Meta Even if Draft
- How to add a fixed shopping cart button on the bottom of the page?
- WooCommerce – different icons for product categories
- WordPress returning “XHR” even when access keys are used
- Woocommerce Languages Files
- How to get woocommerce integration instance?
- Understanding WooCommerce Build-In Geolocation/ Geo_IP classes
- WooCommerce Admin Only Email Hook
- Woocommerce – Dynamic Link to The Most Recently Added Product
- How to adjust Related Page Thumb Sizes on single page?
- Create woocommerce order on new user registration
- Adding more than one item to Woocommerce cart
- How to put a date range in a virtual/downloadable product? [closed]
- How to set up a single product shop with woocommerce? Skipping the product archive
- I’m trying to display product categories on each product in the list
- Update products, terms and relations via SQL
- Cross-sells on WooCommerce product page
- Woocommerce Child Category Permalink Structure Change
- How to allow registration only from a certain location?
- Add confirmation popup on place order button