Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 37
  1. #21
    Join Date
    Aug 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Too bad no one seems interested in this thread

  2. #22
    Join Date
    Aug 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Ok--here's a solution that works for me...

    the other 'fix' here, wasn't a fix at all, I've got a complex site with many category levels.... etc.

    Ok, here's the code I started with in the file: tpl_shopping_cart_default.php
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT) . '</a>'; ?></div>


    Now, here's what I changed it to:
    <div class="buttonRow back"><a href="<?php echo zen_href_link(FILENAME_DEFAULT, "cPath=$cPath"); ?>"><?php echo zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT); ?></a></div>

    Works perfectly for me, gets right back to the category of the last product I added to the cart.

  3. #23
    Join Date
    Aug 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Quote Originally Posted by dontknowwhatimdoing View Post
    Ok--here's a real solution...

    the other 'fix' here, wasn't a fix at all, I've got a complex site with many category levels.... etc.

    Ok, here's the code you start with in the file: tpl_shopping_cart_default.php
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT) . '</a>'; ?></div>


    Now, here's what you change it to:
    <div class="buttonRow back"><a href="<?php echo zen_href_link(FILENAME_DEFAULT, "cPath=$cPath"); ?>"><?php echo zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT); ?></a></div>

    Works perfectly for me, gets right back to the proper listing.
    Turns out this is a halfway solution. It only works if someone uses the "add to cart button". If they view the product listing first, it does not work.

    Here's a good question I think: how can I make sure the $cpath variable gets loaded if someone is adding to cart from a product listing?

  4. #24
    Join Date
    Aug 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Blah, blah, blah...ignore everything else I wrote (unless you have a proper PHP solution, then cough it up!)

    Ok--the only solution I can come up with, is just a simple javascript back. If the user has javascript disabled, then oh well.

    Nothing else works 100% or even 60% properly for me.

    You can see the old version of the button link above, here's the new version:
    <div class="buttonRow back"><a onclick="javascript:history.go(-1)"><?php echo zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT); ?></a></div>


    Notice.. I didn't include <a href="...

    The reason is, I think it looks a bit sloppy, so I just buried the function inside an onclick function.

    If I clean up my store URLs, I might do this to a lot of buttons if I'm too lazy to fix internal links...

    Sneaky, sneaky, sneaky...

  5. #25
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Just want to say thank you! I never had time to do it earlier but I have this installed on all carts I maintain. This is a must! What good is it if you put something in your cart and after you want to go back shopping and you get bounced to the home page? Most likely I would like to continue where I left off shopping. Right?

    Its like at the brick and mortar store they would send you back to the door every time you put something in the shopping basket!

    Feature should be standard behavior.
    Live and learn... the Zen way.

  6. #26
    Join Date
    Apr 2005
    Posts
    3
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    I haven't tested it completely, and I've got way too much extra code to verify it works on a "normal" site, but it looks like the problem is in

    "includes/functions/functions_general.php"

    around lines 992 and 1010, there is
    if (sizeof($_SESSION['navigation']->path)-2 > 0) {

    I changed this to be
    if (sizeof($_SESSION['navigation']->path)> 1) {

    and then the continue shopping button took me back to the page I was looking at when I added the product to the cart....

    Your results may vary.. but it's something to try....

  7. #27
    Join Date
    Nov 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Quote Originally Posted by vrtisworks View Post
    I haven't tested it completely, and I've got way too much extra code to verify it works on a "normal" site, but it looks like the problem is in

    "includes/functions/functions_general.php"

    around lines 992 and 1010, there is
    if (sizeof($_SESSION['navigation']->path)-2 > 0) {

    I changed this to be
    if (sizeof($_SESSION['navigation']->path)> 1) {

    and then the continue shopping button took me back to the page I was looking at when I added the product to the cart....

    Your results may vary.. but it's something to try....
    thank you!

    Its working perfectly for me so far.

  8. #28
    Join Date
    Jan 2009
    Location
    Syracuse, IN
    Posts
    3
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Quote Originally Posted by dontknowwhatimdoing View Post

    You can see the old version of the button link above, here's the new version:
    <div class="buttonRow back"><a onclick="javascript:history.go(-1)"><?php echo zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT); ?></a></div>


    Man, this is sooo cool! I've been trying to figure out how to do this for hours! Thank you!
    Druber

  9. #29
    Join Date
    Jan 2006
    Posts
    229
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    I just wanted to say that when I added Adelante's code to the site I'm working on, it broke my product listing index pages.

    In case it happens to anyone else, it's because of the comments. Session data truly must be the FIRST thing that shows up on a page. Stuff that is commented out is okay, BUT he's using HTML comments, not PHP. Therefore HTML is showing up before the session data - and breaking the pages.

    To fix it, just replace his original code with this:

    Code:
    <?php // reset the session variable
    unset($_SESSION["last_category_visited"]);
    // change the variable from "last category visited" to "current product category number"
    session_start();
    $_SESSION["last_category_visited"] = $current_category_id;
    ?>
    note how now the comments are within the PHP tags - so the session data is *still* first in line. It works like a charm now.

  10. #30
    Join Date
    May 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Can you change the "back to shopping" behaviour?

    Quote Originally Posted by vrtisworks View Post
    I haven't tested it completely, and I've got way too much extra code to verify it works on a "normal" site, but it looks like the problem is in

    "includes/functions/functions_general.php"

    around lines 992 and 1010, there is
    if (sizeof($_SESSION['navigation']->path)-2 > 0) {

    I changed this to be
    if (sizeof($_SESSION['navigation']->path)> 1) {

    and then the continue shopping button took me back to the page I was looking at when I added the product to the cart....

    Your results may vary.. but it's something to try....
    Is there a way to have the button take you to a specific URL instead of just going back?

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Can't change the "price" and "Item Name" Link
    By thricelll in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 27 Feb 2011, 08:16 AM
  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. How can I pre-set the "Back to Shopping"?
    By dhcernese in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 7 Aug 2008, 06:12 PM
  5. How can I change how the "Back" button works/displays?
    By askjv in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Nov 2007, 10:52 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