[TEP-COMMIT] CVS: catalog/catalog/includes/classes currencies.php,1.16,1.17
Harald Ponce de Leon <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tep/catalog/catalog/includes/classes
In directory sc8-pr-cvs1:/tmp/cvs-serv10730/classes
Modified Files:
currencies.php
Log Message:
use the new session class
move the currency_exist function from the general.php functions list to the
currency class - it now looks in the memory for the currency instead of
making a separate sql query for the lookup
Index: currencies.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/classes/currencies.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- currencies.php 5 Jun 2003 23:16:46 -0000 1.16
+++ currencies.php 17 Nov 2003 19:15:06 -0000 1.17
@@ -33,9 +33,9 @@
// class methods
function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
- global $currency;
+ global $osC_Session;
- if (empty($currency_type)) $currency_type = $currency;
+ if (empty($currency_type)) $currency_type = $osC_Session->value('currency');
if ($calculate_currency_value == true) {
$rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];
@@ -70,6 +70,14 @@
function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
+ }
+
+ function exists($code) {
+ if (isset($this->currencies[$code])) {
+ return true;
+ }
+
+ return false;
}
}
?>
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl