Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2005
    Location
    Brooklyn NY
    Posts
    507
    Plugin Contributions
    0

    Default Redirect after login is wrong how do I change it?

    when I add something to the cart and then go to check out and it asks me to log in after I login it takes me to the front page not to the check out how can I fix that? It does the same thing when I create an account.

    here is the codes I found.
    /includes/modules/pages/login/header_php.php
    Code:
    $sql = "UPDATE " . TABLE_CUSTOMERS_INFO . "
                  SET customers_info_date_of_last_logon = now(),
                      customers_info_number_of_logons = customers_info_number_of_logons+1
                  WHERE customers_info_id = :customersID";
    
          $sql = $db->bindVars($sql, ':customersID',  $_SESSION['customer_id'], 'integer');
          $db->Execute($sql);
          $zco_notifier->notify('NOTIFY_LOGIN_SUCCESS');
    
          // restore cart contents
          $_SESSION['cart']->restore_contents();
          /*
          if ($_SESSION['cart']->count_contents() > 0) {
          zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING));
          }

    /includes/modules/pages/create_account_success/header_php.php
    Code:
    if (sizeof($_SESSION['navigation']->snapshot) > 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']);
      $_SESSION['navigation']->clear_snapshot();
    } else {
      $origin_href = zen_href_link(FILENAME_DEFAULT);
    }
    
    // redirect customer to where they came from if their cart is not empty and they didn't click on create-account specifically
    if ($_SESSION['cart']->count_contents() > 0) {
      if ($origin_href != zen_href_link(FILENAME_DEFAULT)) {
        zen_redirect($origin_href);
      }
    }

  2. #2
    Join Date
    Jul 2005
    Location
    Brooklyn NY
    Posts
    507
    Plugin Contributions
    0

    Default Re: Redirect after login is wrong how do I change it?

    any ideas?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Redirect after login is wrong how do I change it?

    Quote Originally Posted by touchclothing View Post
    when I add something to the cart and then go to check out and it asks me to log in after I login it takes me to the front page not to the check out how can I fix that? It does the same thing when I create an account.
    That's not how a brand new uncustomized clean install works.
    Normally if it redirects you to login as part of checkout, it takes you right back to the checkout page you were expecting once you've logged in.

    Perhaps you have one or more addons or code customizations that are breaking the default behavior.
    .

    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.

  4. #4
    Join Date
    Jul 2005
    Location
    Brooklyn NY
    Posts
    507
    Plugin Contributions
    0

    Default Re: Redirect after login is wrong how do I change it?

    I did not build the site. I am just trying to help some out.

  5. #5
    Join Date
    Aug 2009
    Posts
    9
    Plugin Contributions
    0

    Default Re: Redirect after login is wrong how do I change it?

    I'm building our store using ZC version 1.3.8....my partner and I are creating our own custom template.

    If we wanted the login to redirect to an alternatve page, say an EZPage what code would need to be changed to do it?

    I was thinking that I could simply update the redirect variable being used in the login.php code to replace the FILENAME_DEFAULT with FILENAME_EZPAGES and specify the page number?

    any better ideas?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Redirect after login is wrong how do I change it?

    That sounds right. What happened when you did that?
    .

    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.

  7. #7
    Join Date
    Aug 2009
    Posts
    9
    Plugin Contributions
    0

    Default Re: Redirect after login is wrong how do I change it?

    sorry about the delayed response...I was away and I haven't found a way to get notified of responses?

    I couldn't figure out what page and exactly what to edit. After all FILENAME_DEFAULT is used 1100 times so how do I know which login is for the store and which is for the Admin console?

    any suggestions would be appreciated.

    thanks in advance.

    Jon

  8. #8
    Join Date
    May 2006
    Posts
    84
    Plugin Contributions
    0

    Default Re: Redirect after login is wrong how do I change it?

    I've had this problem a couple of times recently - I've found that setting Recrete Session to false in Config > Sessions gets rid of the problem most of the time (it's happened on several sites), but not always.

    I think the problem has to do with the users session as I don;t think the $_SESSION['navigation'] variable is being setup/accessed correctly.

    Does this give anyone any pointers or ring any bells?

    Thanks

    Andy

  9. #9
    Join Date
    Aug 2009
    Location
    Tampa Bay
    Posts
    251
    Plugin Contributions
    1

    Default Re: Redirect after login is wrong how do I change it?

    this is what is happening with mine from the begining of a clean install (thought it is default set-up) and been searching posts in forum to redirect back to shopping cart or last viewed product page instead of main page.
    blessed be the day we make tomorrow a better yesterday

 

 

Similar Threads

  1. admin login says wrong pass word- even after I change it
    By RonGin in forum General Questions
    Replies: 2
    Last Post: 13 Jul 2013, 11:36 PM
  2. 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
  3. how does login page decide where to redirect after create an account?
    By weber in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 May 2009, 11:59 AM
  4. redirect after login
    By teva in forum General Questions
    Replies: 8
    Last Post: 7 Feb 2008, 09:18 PM

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