Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Navigation snapshot code broken?

    I've been looking into why I'm always redirected to my website's home page after I login. On most ecommerce websites I expect to be directed back to the previous page.

    Can someone please explain what the following code in includes/modules/pages/login/header_php.php does?

    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);
            } else {
              zen_redirect(zen_href_link(FILENAME_DEFAULT, '', $request_type));
            }
    To me, it looks like it sends the visitor to their last page (before logging in). However, I always end up on the home page.

    Is this code broken?

    All the best,

    Alex

  2. #2
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: Navigation snapshot code broken?

    I have used this and it seemed to work.
    Code:
    Fix back history to previous page modules/pages/login/header_php.php
    org code:
    } else {
        zen_redirect(zen_href_link(FILENAME_DEFAULT));
    }
    replace with:
    } else {
        $origin_href = zen_back_link_only(true);
        zen_redirect($origin_href);
    }
    Skip
    • 446F63746F722057686F •

  3. #3
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Navigation snapshot code broken?

    .

    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
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: Navigation snapshot code broken?

    Sorry missed that update.

    Skip
    • 446F63746F722057686F •

  5. #5
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Navigation snapshot code broken?

    I'm currently using this code and experience the following issue.

    If I am on a product_info page and then login I will be returned to that same product_info page - which is correct.

    However, If I'm on the shopping_cart page and login I will be returned to the home page - which is incorrect (as I should be redirected back to the shopping_cart page.

    Does anyone else experience this?

    Regards,

    Alex

  6. #6
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Navigation snapshot code broken?

    That's normal, as there is no snapshot taken on the shopping cart page. Snapshots are only taken on pages that require login. However, if you click the "Go to Checkout" button, a snapshot will be taken if the customer isn't logged in yet, then they will be taken to the login page, and then returned to checkout normally.
    .

    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
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Navigation snapshot code broken?

    Thanks for explaining this.

    Is it possible to take snapshots on all pages (to ensure that the customer is returned to their previous page after login)?

    I'm currently using sessions to achieve the above. If I could simply modify the snapshot code that already exists that would obviously be much better.

    All the best,

    Alex

  8. #8
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Navigation snapshot code broken?

    See Similar Threads below for ideas.
    .

    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.

  9. #9
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Navigation snapshot code broken?

    Thanks DyByte.

    I've currently written some code that I'm using (just on the login page) to work around this. All appears to be working well... so I'll stick with it for now.

    Regards,

    Alex

 

 

Similar Threads

  1. Replies: 10
    Last Post: 14 May 2014, 07:25 AM
  2. Where is navigation history snapshot cleared?
    By damiantaylor in forum General Questions
    Replies: 0
    Last Post: 30 Aug 2012, 06:41 PM
  3. broken code in ezpage name
    By contrive.it in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 1 Sep 2011, 08:04 AM
  4. Where to place code for navigation header?
    By jasonhoward64 in forum Basic Configuration
    Replies: 1
    Last Post: 1 Nov 2009, 12:28 AM

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