Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Login redirect modification?

    I'm looking for a way to change the login redirect. As it works right now the user is redirected to the last page they visited before signing in if they were not in the process of checkout, I would like to change it so that the user is redirected to the home page after they signed in and were not in the process of checking out. If they were checking out then I'd like the process to remain the same.

    I've followed some code to around line 145 of includes/modules/pages/login/header_php.php where it looks like this is happening but when I start changing things my site starts acting strange.

  2. #2
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Re: Login redirect modification?

    I should mention I thought the line:

    } else {

    zen_redirect(zen_href_link(FILENAME_DEFAULT, '', $request_type));

    was supposed to redirect to the home page, but in reality you end up on your last viewed page?

  3. #3
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Re: Login redirect modification?

    I just can't seem to crack this one, my problem seems to be in his bit of code,

    Code:
     if (sizeof($_SESSION['navigation']->snapshot) > 0) {
              //    $back = sizeof($_SESSION['navigation']->path)-2;
              //if (isset($_SESSION['navigation']->path[$back]['page'])) {
              //    if (sizeof($_SESSION['navigation']->path)-2 > 0) {
              $origin_href = zen_href_link($_SESSION['navigation']->snapshot['page'], zen_array_to_string($_SESSION['navigation']->snapshot['get'], array(zen_session_name())), $_SESSION['navigation']->snapshot['mode']);
              //            $origin_href = zen_back_link_only(true);
              $_SESSION['navigation']->clear_snapshot();
    
    
    		  zen_redirect($origin_href);
    anytime I change this zen_redirect($origin_href); to redirect to the home page or other page, it does the redirect, but also messes with the checkout process which no longer works the same. my guess is the code for the $origin_href needs to be tweaked so it does not return to the last page viewed, but I haven't a clue as how to do that?

    Can anybody advise?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Login redirect modification?

    Quote Originally Posted by skylab001 View Post
    I'm looking for a way to change the login redirect.
    The all-important question is: WHY? What specific business problem are you trying to solve by confusing your customers?
    .

    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.

  5. #5
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Re: Login redirect modification?

    Quote Originally Posted by DrByte View Post
    What specific business problem are you trying to solve by confusing your customers?
    I believe that by saying 'confusing the customer' your basing it on your personal opinion of how a store should operate. I only have a few products, all of which are listed on the home page, so if you are checking out, then logging in and being sent to checkout page 1 is perfect as it is. But If you are just logging in to log in, I think you should be redirected to the home page or the My account page, and not back to the last item viewed, and that seems to be how it works. That's how I see it at least.

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Login redirect modification?

    Quote Originally Posted by skylab001 View Post
    I believe that by saying 'confusing the customer' your basing it on your personal opinion of how a store should operate.
    I beleive that was a poor choice of words... A better statement would be "Are you trying to frustrate the customer?"

    Quote Originally Posted by skylab001 View Post
    if you are checking out, then logging in and being sent to checkout page 1 is perfect as it is. But If you are just logging in to log in, I think you should be redirected to the home page or the My account page, and not back to the last item viewed, and that seems to be how it works. That's how I see it at least.
    Back in the long dim dark past, many stores did work the way you would prefer, but most stores have evolved considerably and now work the same way that Zencart does, namely, after login it takes you back to the last product viewed. Many studies have indicated that the majority of people prefer this because it saves the hassle of having to relocate the item that they were looking to buy when they chose to log in.

    Since most good stores now function in this manner, people have come to *expect* this behaviour, and as such, they tend to get very frustrated when they come across a store that does things in ways that they are not accustomed. I know it certainly frustrates me.

    Sorry I can't help with what you are attempting to do. I don't know this part of the zencart code well enough to give a solution of the top of my head, and it isn't in my nature to go out of my way to help someone shoot themselves in the foot (metaphorically speaking).

    Cheers
    Rod

  7. #7
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Login redirect modification?

    Quote Originally Posted by skylab001 View Post
    I believe that by saying 'confusing the customer' your basing it on your personal opinion of how a store should operate.

    ...

    But If you are just logging in to log in, I think you should be redirected to the home page or the My account page, and not back to the last item viewed, and that seems to be how it works. That's how I see it at least.
    And indeed, as you say, that is your opinion. I too wonder whether you're pushing yours upon your customers.
    So, instead of arguing about it, I suggest:
    Have you asked your customers if they really like being taken someplace other than where they were at when they clicked to log in?
    If your customers are asked "is it okay to leave it like it is?" and they say yes, then that saves you a lot of trouble, doesn't it?
    If you try to coach them into answering in such a way that proves your own preference, then of course you'll have more work to do as you troubleshoot your coding problem.
    .

    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.

  8. #8
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Re: Login redirect modification?

    It's not that I don't respect your opinions, I only have a few products, which are all on the index page. So when the user logs in and is returned to a product_info page that is unformatted, it's puzzling as to why they are on a page that looks nothing like the rest of the site.

    That is the reason for needing to be redirected to the home page. I'm sorry, I was just asking for help. And yes I've talked to a handful of people testing the site for me that have mentioned this is a problem and suggested what I am asking.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Login redirect modification?

    Quote Originally Posted by skylab001 View Post
    I only have a few products, which are all on the index page. So when the user logs in and is returned to a product_info page that is unformatted
    I don't follow. If your products are on the index page, that suggests to me that the customer is ON the index page. So when they click the Login link, they will indeed be returned back to the index page.
    They would only be sent to the product page if they had actually clicked a link to go TO the product page in the first place.
    .

    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.

 

 

Similar Threads

  1. Replies: 3
    Last Post: 15 May 2014, 05:35 PM
  2. Replies: 1
    Last Post: 16 Apr 2011, 07:24 PM
  3. Login Link - Can I redirect to My Account after login?
    By perkiekat in forum General Questions
    Replies: 2
    Last Post: 3 Feb 2010, 01:34 AM
  4. Catagory Link Redirect / Modification
    By dousacu in forum General Questions
    Replies: 15
    Last Post: 30 Sep 2008, 03:54 PM
  5. Login box header modification?
    By xt0rt in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 10 Jun 2008, 10:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR