Forums / Templates, Stylesheets, Page Layout / Back button that does not take you back

Back button that does not take you back

Locked

Started by woodymon on 11 Aug 2007, 5:06 AM · Views: 2,209

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
11 Aug 2007, 5:06 AM
#1
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Back button that does not take you back

I'm embarrassingly ignorant this eve.

Privacy Policy has a "back" button on it which works correctly by default when clicking on Privacy Policy links located in various Zen Cart menus.

But when I hard code a link to the privacy policy (/shop/index.php?main_page=privacy), for instance on top of the create_account page (https), the back button on privacy page does not direct the browser back to the create_account page. Just redirects browser to home page.

There must be a simple trick to make this work. Any clues? Thanks.

Woody

11 Aug 2007, 5:19 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Back button that does not take you back

Add a referer to your hard code

Zen-Venom Get Bitten

11 Aug 2007, 5:28 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Back button that does not take you back

Slippy fingers meant a return code

Zen-Venom Get Bitten

11 Aug 2007, 6:25 AM
#4
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Back button that does not take you back

kobra:

Slippy fingers meant a return code
Example please? :wink2:

11 Aug 2007, 5:13 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Back button that does not take you back

As you are working in Zen Cart - here is some code from the checkout_process.php file -
This is the check if they are logged in and if not sends them to login and then returns them to the checkout
the snapshot is what you want and this has to be set from whence they came

   // validate customer
    if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
      $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_SHIPPING));
      zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
  }

Zen-Venom Get Bitten

11 Aug 2007, 8:20 PM
#6
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Back button that does not take you back

kobra:

As you are working in Zen Cart - here is some code from the checkout_process.php file -

This is the check if they are logged in and if not sends them to login and then returns them to the checkout the snapshot is what you want and this has to be set from whence they came

// validate customer
if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
$_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_SHIPPING));
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
}


Thanks Kobra, 

I should have been looking for code like that on the login page in the first place. 

Instead I was looking at tpl_privacy_default:

```php
<div class="buttonRow back">
<?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?>
</div>

I was having trouble understanding how zen_back_link function works with sessions and SSL. A complex subject I know. But now that you pointed out the zen_redirect code above I don't have to dig any further or know much more...for now. Thanks!

BTW your last post did not show up in my forum User CP subscription list (I am subscribed to all threads which I post). And the thread was not listed when I searched the forum on my username. Strange.

Woody

12 Aug 2007, 3:12 AM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Back button that does not take you back

BTW your last post did not show up in my forum User CP subscription list (I am subscribed to all threads which I post). And the thread was not listed when I searched the forum on my username. Strange.
Hummmm...I do not have control over this?? Maybe I am banned or something?

Zen-Venom Get Bitten