Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default How to link "Back to Product List" button back to last page history

    I have a client who has many products. Problem is when viewing a product and you click the "Back to Product List" you are taken back to page 1 at the top of the page. It would be better if you could return to the page you were previously viewing (or to same area of the multiple product list which is the same page and product you are viewing).

    In his case if you are on page 5 and you click a product for detail, and then when you click "Back to Product List" it would be nice to go back to page 5 of the multiple product list. Not all the way back to the very top of page 1 again.

    I have read these posts: http://www.zen-cart.com/showthread.p...k+product+list and http://www.zen-cart.com/showthread.p...-Page-Sessions

    Wish Zen Cart would give us a setting like: take back to first product or take back to same product page in multiple products view, that pertains to this list.

    It seems like this never got addressed. This seems to be a re-occuring issues others are having. Years later I am seeking the same answer. Does anyone have an answer for this as of yet?

  2. #2
    Join Date
    Feb 2014
    Location
    Markham, Ontario, Canada
    Posts
    5
    Plugin Contributions
    0

    Default Re: How to link "Back to Product List" button back to last page history

    One way to do this would be with HTML (change what the button does in the places it appears in the files).

    I did a search for "html for back button" - it is Javascript based (so client side - they can have it off) - and it depends on using the browser history - if they arrived at the page by search engine or bookmark it will not work. There are easily half a dozen useful relevant links on the first page (W3Schools etc).

    The other way to do it would be with PHP

    Code:
    <?php
      $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
      echo "<a href='$url'>back</a>"; 
    ?>
    The question is, the browser already has this built in - are you trying to provide a different function to the browser back button?

  3. #3
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: How to link "Back to Product List" button back to last page history

    Quote Originally Posted by sports guy View Post
    I have a client who has many products. Problem is when viewing a product and you click the "Back to Product List" you are taken back to page 1 at the top of the page. It would be better if you could return to the page you were previously viewing (or to same area of the multiple product list which is the same page and product you are viewing).

    In his case if you are on page 5 and you click a product for detail, and then when you click "Back to Product List" it would be nice to go back to page 5 of the multiple product list. Not all the way back to the very top of page 1 again.

    I have read these posts: http://www.zen-cart.com/showthread.p...k+product+list and http://www.zen-cart.com/showthread.p...-Page-Sessions

    Wish Zen Cart would give us a setting like: take back to first product or take back to same product page in multiple products view, that pertains to this list.

    It seems like this never got addressed. This seems to be a re-occuring issues others are having. Years later I am seeking the same answer. Does anyone have an answer for this as of yet?
    In looking at data captured by superglobals, there is some back information that is captured at least for two levels inside of Zen Carts data. That said, should be able to test if there is no back data associated with a desired location, then to behave a certain way.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Feb 2014
    Location
    Amsterdam, Netherlands
    Posts
    9
    Plugin Contributions
    1

    Default Re: How to link "Back to Product List" button back to last page history

    Been looking for this. Ended up coding something myself, maybe someone has good use with this:

    PHP Code:
    $pathlength count($cPath_array);
    $pathcount 1;
    $category_url '';
    foreach(
    $cPath_array as $catID) {
      
    $category_url .= $catID;
      if (
    $pathcount $pathlength && $pathlength 1) {
        
    $category_url .= '_';
      }
      
    $pathcount++;
    }
    echo 
    '<a href="' zen_href_link(FILENAME_DEFAULT'cPath=' $category_url) . '">Terug</a>'

 

 

Similar Threads

  1. how to make "back" button really go back?
    By lina0962 in forum General Questions
    Replies: 23
    Last Post: 18 Nov 2010, 09:56 PM
  2. How can I "flip" layout of Back to Shopping button with the Shipping Estimator button
    By MarleneF in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 7 May 2010, 09:38 PM
  3. How can I hide the "back to shopping" button?
    By heheno1 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 May 2009, 10:56 PM
  4. "Back To List" button on product detail returning to page 1
    By smythmikey in forum General Questions
    Replies: 1
    Last Post: 3 Feb 2009, 07:18 AM
  5. How to link "Product List" button back to last page history
    By tapsilog in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 31 Oct 2008, 10:36 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