You can use wordpress referrer function.
For example set referrer URL in session by clicking on add to cart button or any button to store previous URL. Once login or register success add Woocommerce success login redirect to that URL.
For more information read WordPress referrer URL read here;
https://codex.wordpress.org/Function_Reference/wp_get_referer
For Woocommerce login redirect read here;
https://stackoverflow.com/questions/29342186/woocommerce-after-login-redirect
Related Posts:
- Woocommerce Login Redirect not working [closed]
- Redirect user after login through woocommerce login page to page with his/her username?
- How to check if is in cart page? [closed]
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- Custom Redirect after registration in WooCommerce
- Import products to WooCommerce by CSV page won’t open [closed]
- Woocommerce login not working on the first try
- Redirect customer to login page (with other signup plugin) if user not logged in when proceeding to checkout
- Woocommerce – Want to block a user agent from accessing specific product pages
- How to – proper WordPress 301 redirects?
- WooCommerce – Redirect to a product after login
- Woocommerce, prevent login after registration and redirect to custom URL
- Woocommerce Login Redirect to old domain
- Redirect no product url’s to static url
- WooCommerce Registration redirect based on page ID
- wordpress/woocommerce login url not redirecting correctly
- WooCommerce get_author_posts_url() – Author URL redirecting to shop base
- Anonymous users can not access website
- Is it ok to 301 redirect product-category pages to custom pages?
- WooCommerce and ACF: How to Redirect Upon Add to Cart – Partially Working Example
- wordpress site auto redirect to another site when I enable woocommerce
- How to use woo commerce login to authenticate code php pages?
- mydomain.com/wp-login redirects to wordpress.com/wp-login
- Woocommerce login to specific page or referrer
- WooCommerce shop, my account, cart every page redirect to home page [closed]
- How to change redirect code? [duplicate]
- Login page so wide [closed]
- Remove login fields from /customer-account page [closed]
- Redirect user to original url after login?
- Order by rating not works in wp_query
- How can I include a query string with get_permalink
- WooCommerce Change Product Global Attribute Value via CRUD for Simple Product [closed]
- Change WooCommerce Image Size in One Product CAtegory
- Is there a way to get customers logged out without calling wp-login.php?
- how to do logout redirect to current url
- WooCommerce checkout: How can I change $field_container of a checkout field?
- Woocommerce Shop Price Position
- How to disable users from editing billing address in WooCommerce checkout?
- Move WooCommerce product tabs out of the tabs [closed]
- Show add to cart button on shop woocommerce
- How do I hide the purchase note in the WooCommerce ‘order completed’ email?
- Woocommerce – Override the default templates location under the theme directory
- How to hide out of stock products in Related Products via custom query in WooCommerce
- Changing Woocommerce language without changing the language in Dashboard admin WordPress
- WooCommerce Country Drop Down colours CSS [closed]
- Fatal error: Call to undefined method WooCommerce::nonce_field()
- Where do I find where woocommerce stores product data in cpanel file manager?
- Function to recalculate shipping costs on subscriptions after renewal with Automatewoo
- Creating a multisite registration form that also creates a woocommerce post
- How to show tag count for individual product post in wordpress woocommerce
- Checkout is blocked with blockUI when using action woocommerce_cart_calculate_fees
- API returns blank response after installing & uninstalling WP-rest-api plugin
- Tried to create a user role that can only edit user information, but my test account cannot view the dashboard. What am I missing?
- Filtering variable WooCommerce products by stock level using meta_query
- How can I run a multi language WordPress site in two folders in one install? [closed]
- Dropdown menu not displaying WordPress
- Adding a custom Shipping methods field to an order
- WooCommerce – Create multiple product tags via rest api endpoint
- WooCommerce which roles and capabilities control user login re-direct to Woo Account Page?
- Conditional action hook
- Sending Email upon registration
- Migrating data from Woocommerce to another webapp
- Prevent “/login” to redirect to “/wp-login”
- Options to develop a non-ecommerce catalog?
- Redirect certain pages if user logged in
- wp_set_object_terms setting only first id from array
- I need to export all products and images but I don’t know which table the images are in
- Add only sku to product url woocoomerce
- Purchase/order statistics plugin for viewing per payment menthod?
- Displaying Woocommerce Product Attributes on single product page
- Categories on attribute archive pages
- How to solve `Error getting remote image` in woocommerce rest api script?
- How to force Woocommerce to deliver the product to the paypal adress which was used?
- Add username and password section in WooCommerce’s my account page
- Woocommerce: Search by custom attribute
- How to change user role after login?
- WooCommerce free shipping twice a week
- Product overlapping header
- merge tabs in woocommerce
- How to import products to Woo Commerce given that WP All Import keeps timing out
- How to make a custom redirect in WooCommerce?
- Firstname and lastname greyout or hidden Billing details at next checkout like username is hidden [closed]
- how to add custom reviews button in woocommerce order complete generated mail
- Click Count on Download a File
- How to add coupon expiry date into the followup emails?
- Not all strings are translated
- Custom Woocommerce checkout filed yields a Json error when validating [closed]
- access Woo commerce | WordPress methods externally
- How to display Woocommerce catagories
- Woocommerce set single city to sell to
- eCommerce solution doesn’t want to display its shortcodes or any content where it’s set to [closed]
- Woocommerce hidden fields with meta keys and values. how?
- How do I make a diagonal strikethrough on wordpress? [closed]
- Woocommerce – Remove ‘Buy Product’ Button from shop page [closed]
- Translate Woocommerce tab
- Woocommerce -> gallery images per variation without a plugin? [closed]
- Why is my WordPress admin not working
- Create bookings after subscription renewal
- Change variants URL
- Use a woocommerce hook to create a table and populate it with a query