Jamie2006 Posted April 24, 2008 Share Posted April 24, 2008 Hi, I've been looking over theforum but couldn't find a good answer. Is there any way of blocking the prices when you are not logged in as customer ? Jamie Link to comment Share on other sites More sharing options...
FIMBLE Posted April 24, 2008 Share Posted April 24, 2008 Yes you can do this In catalog/includes/classes/currencies.php ... right down the bottom change: function display_price($products_price, $products_tax, $quantity = 1) { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } } ?> To: function display_price($products_price, $products_tax, $quantity = 1) { if (tep_session_is_registered('customer_id')){ return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } else { return ''; } } } ?> You may wish to hide the cart also ... column_right.php if (tep_session_is_registered('customer_id'))include(DIR_WS_BOXES . 'shopping_cart.php'); In catalog/shopping_cart.php, change: require("includes/application_top.php"); To: require("includes/application_top.php"); if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } Where the code has: } else { return ''; } You can put something like: } else { return 'Login for price'; } Taken from the Documentation tht comes with the OSC. There are also contributions for this too Sometimes you're the dog and sometimes the lamp post [/url] My Contributions Link to comment Share on other sites More sharing options...
Jamie2006 Posted April 24, 2008 Author Share Posted April 24, 2008 Thanks Fimble, I really searched but couldn't find anywhere :'( Yes you can do this In catalog/includes/classes/currencies.php ... right down the bottom change: function display_price($products_price, $products_tax, $quantity = 1) { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } } ?> To: function display_price($products_price, $products_tax, $quantity = 1) { if (tep_session_is_registered('customer_id')){ return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } else { return ''; } } } ?> You may wish to hide the cart also ... column_right.php if (tep_session_is_registered('customer_id'))include(DIR_WS_BOXES . 'shopping_cart.php'); In catalog/shopping_cart.php, change: require("includes/application_top.php"); To: require("includes/application_top.php"); if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } Where the code has: } else { return ''; } You can put something like: } else { return 'Login for price'; } Taken from the Documentation tht comes with the OSC. There are also contributions for this too Link to comment Share on other sites More sharing options...
FIMBLE Posted April 24, 2008 Share Posted April 24, 2008 There are also some add ons here http://addons.oscommerce.com/category?sear...+to+view+prices Sometimes you're the dog and sometimes the lamp post [/url] My Contributions Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.