Guest Posted December 30, 2004 Share Posted December 30, 2004 Does anyone have a solution to hide prices from "guest" users? I am setting up a B2B only website and only want to have authorized customers be able to see product prices. I did try the "loginviewprice" contribution; however, I found that it is not compatable with oscommerce-2.2ms2. Quote Link to comment Share on other sites More sharing options...
boxtel Posted December 30, 2004 Share Posted December 30, 2004 Does anyone have a solution to hide prices from "guest" users? I am setting up a B2B only website and only want to have authorized customers be able to see product prices. I did try the "loginviewprice" contribution; however, I found that it is not compatable with oscommerce-2.2ms2. <{POST_SNAPBACK}> you could hack the currencies->display_price function to return nothing when the customer_id is not registered i.e. he is not logged on. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
Guest Posted December 30, 2004 Share Posted December 30, 2004 This is to the end of catalog/includes/classes/currencies.php: function display_price($products_price, $products_tax, $quantity = 1) { if (!tep_session_is_registered('customer_id')) { return "Login For Price"; } else { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } } } ?> Matti Quote Link to comment Share on other sites More sharing options...
Guest Posted December 30, 2004 Share Posted December 30, 2004 Thank you! That code snippet works beautifully. Quote Link to comment Share on other sites More sharing options...
Steel Posted February 14, 2005 Share Posted February 14, 2005 YOU ROCK MATTI!!! Thanks again for the great advice Quote Link to comment Share on other sites More sharing options...
Steel Posted February 16, 2005 Share Posted February 16, 2005 This works great but I have found that it will still show the price in the shopping cart even if not logged in. I was thinking that a way to fix this would be to disable the shopping cart to non logged in customers. I know it would be a mod to the shopping_cart.php but I just can't seem to get it right. :o Any Ideas??? ~Steel Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.