bluedragon Posted July 5, 2007 Share Posted July 5, 2007 Hi I need some help ! The store that I'm making is a Wholesale Catalog. I need the product price only can be seen after my registed customer loged in. Is there away to block the price, before customer login? I was hoping someone could help me with this. and I will be very appreciate . Coral Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 HiI need some help ! The store that I'm making is a Wholesale Catalog. I need the product price only can be seen after my registed customer loged in. Is there away to block the price, before customer login? I was hoping someone could help me with this. and I will be very appreciate . Coral Check the contrib area for price for logged in customers or something like that. Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 in includes/classes/currencies.php in place where products price returning add code: if(tep_session_registered('customers_id')){ //here normal code which returning price } else { return TEXT_PRICE_AFTER_LOGIN; } Link to comment Share on other sites More sharing options...
bluedragon Posted July 5, 2007 Author Share Posted July 5, 2007 in includes/classes/currencies.php in place where products price returning add code: if(tep_session_registered('customers_id')){ //here normal code which returning price } else { return TEXT_PRICE_AFTER_LOGIN; } Thank you so much for your reply, I find the file includes/classes/currencies.php could you please tell me where sould I put it in? Thank you! Coral <?php/* $Id: currencies.php,v 1.16 2003/06/05 23:16:46 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License*/////// Class to handle currencies// TABLES: currencies class currencies { var $currencies;// class constructor function currencies() { $this->currencies = array(); $currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES); while ($currencies = tep_db_fetch_array($currencies_query)) { $this->currencies[$currencies['code']] = array('title' => $currencies['title'], 'symbol_left' => $currencies['symbol_left'], 'symbol_right' => $currencies['symbol_right'], 'decimal_point' => $currencies['decimal_point'], 'thousands_point' => $currencies['thousands_point'], 'decimal_places' => $currencies['decimal_places'], 'value' => $currencies['value']); } }// class methods function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') { global $currency; if (empty($currency_type)) $currency_type = $currency; if ($calculate_currency_value == true) { $rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value']; $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];// if the selected currency is in the european euro-conversion and the default currency is euro,// the currency will displayed in the national currency and euro currency if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) { $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>'; } } else { $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right']; } return $format_string; } function is_set($code) { if (isset($this->currencies[$code]) && tep_not_null($this->currencies[$code])) { return true; } else { return false; } } function get_value($code) { return $this->currencies[$code]['value']; } function get_decimal_places($code) { return $this->currencies[$code]['decimal_places']; } function display_price($products_price, $products_tax, $quantity = 1) { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } }?> 1 Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 replace your display_price function with this: function display_price($products_price, $products_tax, $quantity = 1) { if(tep_session_is_registered('customers_id')){ return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } else { return TEXT_PRICE_AFTER_LOGIN; } } Link to comment Share on other sites More sharing options...
bluedragon Posted July 5, 2007 Author Share Posted July 5, 2007 replace your display_price function with this: function display_price($products_price, $products_tax, $quantity = 1) { if(tep_session_is_registered('customers_id')){ return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } else { return TEXT_PRICE_AFTER_LOGIN; } } Hi I put it in there like this but the page turned blank. is there anything wrong, Please help me check it out, Thank you so much! function display_price($products_price, $products_tax, $quantity = 1) { if(tep_session_is_registered('customers_id')){ return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } else { return TEXT_PRICE_AFTER_LOGIN; } --------------------------------------------------------------------------------------------------------------------- below is the original one. function display_price($products_price, $products_tax, $quantity = 1) { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } } ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.