Forums / Developer / wishlist - login - redirect - it goes wrong?

wishlist - login - redirect - it goes wrong?

Author Message

Fabricio Guerrero

Monday 05 March 2007 8:58:58 am

Hi,

I've come accross an issue with eZ wishlist + login + redirect that i can't find an easy fix for...

Currently if you want to use the wishlist you need to be logged on and if your not a form comes up and asks you to do so... which is cool but the issue is that after you logon it redirects you back to the page you came from which is usually the product page and not the complete wishlist. which is not much help. :(

The issue is that if you add:

<input type="text" name="RedirectURI" value="wishlist" />

into the login form it properly redirects but it does NOT add the product into the wishlist... seems as if it redirects right after loggin in and not going through the wishlist adding products code.. in other words it redirects too soon.. it should wait til after product is added.

If I try to do: <input type="text" name="RedirectURIAfterPublish" value="wishlist" />

nothing happens as it makes sense since I've read this only works when form action is set to "content/edit" and not for a login form.

I can only think of hacking the kernel a bit in order to make RedirectURIAfterPublish work with login or so...

maybe do something like: http://ez.no/ezpublish/documentation/customization/tips_tricks/redirecting_after_content_publishing

has any one got any good pointers??? come accross to a similar situation??

thanks,
Fabricio

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...

Claudia Kosny

Monday 05 March 2007 2:34:20 pm

Hi Fabricio

That's looks quite tricky. The problem is that the wishlist needs the posted ContentObjectID and ezOption to add the product to the wishlist. And if you are redirected to the login page, the post data is lost.

A possible approach might be to hack the wishlist.php so it works with sessions as well and put the posted data in the session before the wishlist redirects to the login page.

Since you have already managed to get redirected back to the wishlist after login, the wishlist should then check for session variables, add the product and remove the session variables.

Maybe you should also just add the redirection to the wishlist if one of these session variables is set - after all you don't want to redirect to the wishlist every time someone logs in.

Claudia

Fabricio Guerrero

Tuesday 06 March 2007 12:28:54 am

Hi Claudia,

Thanks for this... it confirms what I suspected... i have to hack the kernel a bit to get this working...

I'll post the results here soon.

Thanks again.
Fabricio

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...