
Originally Posted by
dbabbage
But what I really want, is that when someone clicks that "Log In" link on the navigation bar they are returned after log in to whatever page they clicked it from... whether it be a category listing, or an individual product page, or a EZ Page, or whatever. To me, this is the obvious and expected behaviour that a site user would expect... Can it be done?
There are a number of places to make changes if you want it to happen "everywhere". I'm not so sure it's necessary to do it "everywhere", but the following will do it for your Product-General products. If you want to experiment with adding it elsewhere too, that's fine. However, the only place requiring login would be the product/category pages, the My Account areas, and the normal checkout flow. The My Account and Checkout and tell-a-friend and write-a-review already take care of it. A variation of this will be implemented in a future release. A number of authentication issues come to play in this with the many possible configurable modes in which Zen Cart can run. Consider this a fairly solid bandage:
/includes/modules/pages/product_info/header_php.php
Below this line:
Code:
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
... add the following lines:
Code:
if (!$_SESSION['customer_id']) {
$_SESSION['navigation']->set_snapshot();
}
If you really feel that ezpages also needs it, do the same in the includes/modules/pages/page/header_php.php file.