How can you redirect a user to previous page after the registration?

I have made a custom plugin which disables article reviewing for unregistered users and instead of showing the input form there is a button „Review a product“ which is linked to Registration.

And what I want to know is:

How to redirect the user back to visited product after successfull registration?

Hi ertuzio,

the loginAction of the account controller takes two parameters. shopware/Account.php at 5.3 · shopware/shopware · GitHub
After succesful login, this is the page, where the user will be redirected to. If the two parameters ‚sTarget‘ (controller name) and ‚sTargetAction‘ are not set, the user gets redirected to the account page. 
You can provide these two parameters to redirect where ever you like after the login. 

Best regards from Schöppingen

cool Michael Telgmann

2 „Gefällt mir“

Hello ertuzio,

Just wanted to add, that even though Michael Telgmann described it perfectly, you still could purchase/test a plugin-in the shopware store, which does the job for you.

Just in case you want to save yourself some work time. Wink

http://store.shopware.com/en/comer91460192123/return-back-after-login.html

We used it on our most recent e-commerce solution and it does the job

 

Kind regards,

Max K

 

Edit: Accidently added the link to the german shopware store page

You can provide these two parameters to redirect where ever you like after the login. 

 

cool Michael Telgmann

Not exactly. You cannot redirect to a product detail because sTarget=detail and sTargetAction=index but the missing paramter sArticle=… gets ommited from the loginAction