/** * It creates a new ModelLOPD object class ir if it has been created * before, it return the previous object * * @access public * @since unknown * @return Currency */ public static function newInstance() { if (!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }
function multicurrency_add_prices($formatted_price) { if (osc_item_price() != NULL && osc_item_price() != '' && osc_item_price() != 0) { $rates = ModelMC::newInstance()->getRates(osc_item_currency()); $data = array(); foreach ($rates as $r) { $price = osc_item_price() / 1000000 * $r['f_rate']; $symbol = $r['s_to']; $currencyFormat = osc_locale_currency_format(); $currencyFormat = str_replace('{NUMBER}', number_format($price, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep()), $currencyFormat); $currencyFormat = str_replace('{CURRENCY}', $symbol, $currencyFormat); $data[] = $currencyFormat; } return $formatted_price . ' <a class=MCtooltip href="#">' . __('Other currencies', 'multicurrency') . '<span>' . implode("<br />", $data) . '</span></a>'; } return $formatted_price; }