Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Basic Configuration / Redirect from the Login Page

Redirect from the Login Page

Locked

Started by bgroup99 on 14 Nov 2006, 5:35 PM · Views: 2,763

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
14 Nov 2006, 5:35 PM
#1
bgroup99 avatar

bgroup99

Zen Follower

Join Date:
Aug 2006
Posts:
197
Plugin Contributions:
0

Redirect from the Login Page

Hi,

Currently on my website: When customers login they are redirected to my main page.

What I would like: For customers to be redirected to their shopping cart after loging in.

Is this possible? I realize it probably only requires changing a link in some file, but I don't know the file or the code to look for.

Thanks for any help!

Nate

15 Nov 2006, 3:03 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Redirect from the Login Page

Actually, the login will take you to many places depending on where you were when you tried to login ... providing that location is "known" based on navigation history ...

You can make it that when the location is not known that you go to the shopping_cart or that you go to the shopping_cart when there is something in the shopping_cart to see ...

You would need to edit the:
/includes/modules/pages/login/header_php.php

NOTE: there is NO override for this ... so you should backup the original file and your changes for when you upgrade ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

20 Dec 2006, 10:20 AM
#3
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Redirect from the Login Page

Ajeh:

Actually, the login will take you to many places depending on where you were when you tried to login ... providing that location is "known" based on navigation history ...

You can make it that when the location is not known that you go to the shopping_cart or that you go to the shopping_cart when there is something in the shopping_cart to see ...

You would need to edit the:
/includes/modules/pages/login/header_php.php

NOTE: there is NO override for this ... so you should backup the original file and your changes for when you upgrade ...

Can you make it so that once they login, it ALWAYS takes them to the "My Account" page, no matter where they were before they logged in and even if they are on the way to checking out? (i have my reasons)

Thank You.

20 Dec 2006, 11:12 AM
#4
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Redirect from the Login Page

Sorry, I have it working now.

15 May 2007, 5:26 PM
#5
bradymc avatar

bradymc

New Zenner

Join Date:
Feb 2007
Location:
Dallas area
Posts:
75
Plugin Contributions:
0

Re: Redirect from the Login Page

craftzombie,

Can you post your solution to this problem because I am wanting to do the same thing, but for some reason can't seem to figure it out.

15 May 2007, 5:34 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Redirect from the Login Page

bgroup99:

What I would like: For customers to be redirected to their shopping cart after loging in.

Ajeh:

You would need to edit the:
/includes/modules/pages/login/header_php.php

bradymc:

craftzombie,

Can you post your solution to this problem because I am wanting to do the same thing, but for some reason can't seem to figure it out.As Ajeh said. you'll need to edit:
/includes/modules/pages/login/header_php.php

Find this:$_SESSION['cart']->restore_contents();add this below it:```
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 May 2007, 6:29 PM
#7
bradymc avatar

bradymc

New Zenner

Join Date:
Feb 2007
Location:
Dallas area
Posts:
75
Plugin Contributions:
0

Re: Redirect from the Login Page

Dr Byte,

I tried that and it still takes me to /index.php?main_page=index. I'm wanting it to take them to the "My Account" page. I assume that's probably a simple variable switch, but I wasn't sure if that code put in that location would help my situation.

15 May 2007, 6:34 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Redirect from the Login Page

Use FILENAME_MY_ACCOUNT instead then.

If that's not working, then please list all contributions you've installed, as well as all customizations you've made to your site.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 May 2007, 6:56 PM
#9
bradymc avatar

bradymc

New Zenner

Join Date:
Feb 2007
Location:
Dallas area
Posts:
75
Plugin Contributions:
0

Re: Redirect from the Login Page

Hmmm... strange things are happening. Because now everything works as it should. Maybe it heard your footsteps coming! :)

Do those files take time to update on the servers or something? I had flushed my cache and cookies and just about everything else that I could from memory so that it was forced to get fresh info everytime, but it seems like it just needed some time.