Example #1
0
 function dol($amount)
 {
     $finalAmount = $amount;
     $curSymbol = $this->cart['currency_symbol'];
     if (isset($this->currencies)) {
         $activeCur = Helper_Cart::getActiveCurrency($this->currencies);
         if ($activeCur) {
             $rate = $activeCur['exchange_rate'];
             $finalAmount = $rate * $amount;
             $curSymbol = $activeCur['currency'];
             if (!empty($this->withCurrencySymbol)) {
                 $curSymbol = $activeCur['symbol'];
             }
         }
     }
     $space = ' ';
     if (isset($this->withCurrencySpace) && $this->withCurrencySpace === FALSE) {
         $space = '';
     }
     return $curSymbol . $space . number_format($finalAmount, 2);
 }
Example #2
0
 static function orderToPaypalParams($controller, $order, $member, $transId, $orderType = NULL)
 {
     if ($controller->getKrcoConfigValue('cart', 'with_paypal_convert_currency')) {
         $controller->_activeCurrency = Helper_Cart::getActiveCurrency($controller->_getCurrenciesFromConf($controller->getRawCurrencies()));
     }
     if ($order->getCurrency() == 'IDR') {
         $controller->_activeCurrency = array('title' => 'United States Dollar', 'symbol' => 'US$', 'currency' => 'USD', 'exchange_rate' => self::getCurrencyConversionRate($controller, 'IDR', 'USD'));
     }
     $cart = self::_orderToCartForPaypal($order);
     $orderId = $order->getLongId();
     $params['currency_code'] = $order->getCurrency();
     if (isset($controller->_activeCurrency['currency'])) {
         $params['currency_code'] = $controller->_activeCurrency['currency'];
     }
     $params = self::cartToPaypalParams($controller, $cart, $member) + $params;
     $params['charset'] = 'utf-8';
     //$params['custom'] = "$orderId;$orderType";
     $params['custom'] = $transId;
     $params['notify_url'] = $controller->composeLink(self::_getNotifyPath($controller, $orderType));
     $params['return'] = $controller->composeLink('');
     return $params;
 }