当前位置: 首页>>代码示例>>PHP>>正文


PHP ShopFunctions::getCurrencyByID方法代码示例

本文整理汇总了PHP中ShopFunctions::getCurrencyByID方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions::getCurrencyByID方法的具体用法?PHP ShopFunctions::getCurrencyByID怎么用?PHP ShopFunctions::getCurrencyByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShopFunctions的用法示例。


在下文中一共展示了ShopFunctions::getCurrencyByID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ensureUsingCurrencyCode

 /**
  * Changes the virtuemart_currency_id into the right currency_code
  * For exampel 47 => EUR
  *
  * @author Max Milbers
  * @author Frederic Bidon
  */
 function ensureUsingCurrencyCode($curr)
 {
     if (is_numeric($curr) and $curr != 0) {
         if (!class_exists('ShopFunctions')) {
             require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
         }
         return ShopFunctions::getCurrencyByID($curr, 'currency_code_3');
     }
     return $curr;
 }
开发者ID:lenard112,项目名称:cms,代码行数:17,代码来源:currencydisplay.php

示例2: getListFEPayment

 protected function getListFEPayment(VirtueMartCart $cart, $method)
 {
     $currency_code = ShopFunctions::getCurrencyByID($cart->pricesCurrency, 'currency_code_3');
     $this->_getCartAddressCountryCode($cart, $country_code, $countryId);
     if (!($cData = $this->checkCountryCondition($method, $country_code, $cart))) {
         return NULL;
     }
     $pclasses = KlarnaHandler::getPClasses(NULL, $country_code, KlarnaHandler::getKlarnaMode($method), $cData);
     $this->getNbPClasses($pclasses, $specCamp, $partPay);
     $sessionKlarnaData = $this->getKlarnaSessionData();
     $klarna_paymentmethod = "";
     if (isset($sessionKlarnaData->KLARNA_DATA['klarna_paymentmethod'])) {
         $klarna_paymentmethod = $sessionKlarnaData->KLARNA_DATA['klarna_paymentmethod'];
     }
     $html = '';
     $payments = new klarna_payments($cData, KlarnaHandler::getShipToAddress($cart));
     $payment_params = $payments->invoice($method);
     $payment_form = $this->renderByLayout('payment_form', array('checkout' => $payment_params['fields']['checkout'], 'input' => $payment_params['fields']['input'], 'value' => $payment_params['fields']['value'], 'setup' => $payment_params['fields']['setup'], 'sType' => $payment_params['fields']['sType'], 'pClasses' => $payment_params['pClasses']), 'klarna', 'payment');
     $html .= $this->renderByLayout('displaypayment', array('stype' => 'invoice', 'id' => $payment_params['id'], 'module' => $payment_params['module'], 'klarna_form' => $payment_form, 'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id, 'klarna_paymentmethod' => $klarna_paymentmethod));
     if ($partPay > 0) {
         if ($payment_params = $payments->partPay($cart)) {
             $payment_form = $this->renderByLayout('payment_form', array('checkout' => $payment_params['fields']['checkout'], 'input' => $payment_params['fields']['input'], 'value' => $payment_params['fields']['value'], 'setup' => $payment_params['fields']['setup'], 'sType' => $payment_params['fields']['sType'], 'pClasses' => $payment_params['pClasses']), 'klarna', 'payment');
             $html .= $this->renderByLayout('displaypayment', array('stype' => 'part', 'id' => $payment_params['id'], 'module' => $payment_params['module'], 'klarna_form' => $payment_form, 'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id, 'klarna_paymentmethod' => $klarna_paymentmethod));
         }
     }
     if ($specCamp > 0) {
         if ($payment_params = $payments->specCamp($cart)) {
             $payment_form = $this->renderByLayout('payment_form', array('checkout' => $payment_params['fields']['checkout'], 'input' => $payment_params['fields']['input'], 'value' => $payment_params['fields']['value'], 'setup' => $payment_params['fields']['setup'], 'sType' => $payment_params['fields']['sType'], 'pClasses' => $payment_params['pClasses']), 'klarna', 'payment');
             $html .= $this->renderByLayout('displaypayment', array('stype' => 'spec', 'id' => $payment_params['id'], 'module' => $payment_params['module'], 'klarna_form' => $payment_form, 'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id, 'klarna_paymentmethod' => $klarna_paymentmethod));
         }
     }
     // TO DO add html:
     $pluginHtml = $html;
     return $pluginHtml;
 }
开发者ID:joselapria,项目名称:virtuemart,代码行数:35,代码来源:klarna.php

示例3: getCalcs

 /**
  * Retrieve a list of calculation rules from the database.
  *
  * @author Max Milbers
  * @param string $onlyPuiblished True to only retreive the published Calculation rules, false otherwise
  * @param string $noLimit True if no record count limit is used, false otherwise
  * @return object List of calculation rule objects
  */
 public function getCalcs($onlyPublished = false, $noLimit = false, $search = false)
 {
     $where = array();
     $this->_noLimit = $noLimit;
     // add filters
     if ($onlyPublished) {
         $where[] = '`published` = 1';
     }
     $db = JFactory::getDBO();
     if ($search) {
         $search = '"%' . $db->escape($search, true) . '%"';
         $where[] = ' `calc_name` LIKE ' . $search . ' OR `calc_descr` LIKE ' . $search . ' OR `calc_value` LIKE ' . $search . ' ';
     }
     $whereString = '';
     if (count($where) > 0) {
         $whereString = ' WHERE ' . implode(' AND ', $where);
     }
     $datas = $this->exeSortSearchListQuery(0, '*', ' FROM `#__tsmart_calcs`', $whereString, '', $this->_getOrdering());
     if (!class_exists('ShopFunctions')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
     }
     foreach ($datas as &$data) {
         $data->currencyName = ShopFunctions::getCurrencyByID($data->calc_currency);
         JPluginHelper::importPlugin('vmcalculation');
         $dispatcher = JDispatcher::getInstance();
         $error = $dispatcher->trigger('plgVmGetPluginInternalDataCalcList', array(&$data));
     }
     return $datas;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:37,代码来源:calc.php

示例4: getListFEPayment

	/**
	 * @param VirtueMartCart $cart
	 * @param                $method
	 * @return null|string
	 */
	protected function getListFEPayment (VirtueMartCart $cart, $method) {

		$cart_currency_code = ShopFunctions::getCurrencyByID ($cart->pricesCurrency, 'currency_code_3');
		$country_code = NULL;
		$countryId = 0;
		$this->_getCountryCode ($cart, $country_code, $countryId);
		if (!($cData = $this->checkCountryCondition ($method, $country_code, $cart))) {
			return NULL;
		}
		try {
			$pclasses = KlarnaHandler::getPClasses (NULL, KlarnaHandler::getKlarnaMode ($method, $cData['country_code_3']), $cData);
		}
		catch (Exception $e) {
			vmError ($e->getMessage (), $e->getMessage ());
			return NULL;
		}
		$specCamp = 0;
		$partPay = 0;
		$this->getNbPClasses ($pclasses, $specCamp, $partPay);
		$sessionKlarnaData = $this->getKlarnaSessionData ();

		$klarna_paymentmethod = "";
		if (isset($sessionKlarnaData->klarna_paymentmethod)) {
			$klarna_paymentmethod = $sessionKlarnaData->klarna_paymentmethod;
		}

		$html = '';
		$checked = 'checked="checked"';
		$payments = new klarna_payments($cData, KlarnaHandler::getShipToAddress ($cart));

		if (in_array ('invoice', $cData['payments_activated'])) {
			$payment_params = $payments->get_payment_params ($method, 'invoice', $cart);
			$payment_form = $this->renderByLayout ('payment_form', array('payment_params' => $payment_params, 'payment_currency_info'       => $payment_params['payment_currency_info'],), 'klarna', 'payment');
			$selected = ($klarna_paymentmethod == 'klarna_invoice' AND $method->virtuemart_paymentmethod_id == $cart->virtuemart_paymentmethod_id) ? $checked : "";
			$html .= $this->renderByLayout ('displaypayment', array(
				'stype'                       => 'invoice',
				'id'                          => $payment_params['id'],
				'module'                      => $payment_params['module'],
				'klarna_form'                 => $payment_form,
				'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id,
				'klarna_paymentmethod'        => $klarna_paymentmethod,
				'selected'                    => $selected
			));
		}

		if (in_array ('part', $cData['payments_activated'])) {
			if (strtolower ($country_code) == 'nld') {
				//  Since 12/09/12: merchants can sell goods with Klarna Invoice up to thousands of euros. So the price check has been moved here
				if (!KlarnaHandler::checkPartNLpriceCondition ($cart)) {
					// We can't show our payment options for Dutch customers
					// if price exceeds 250 euro. Will be replaced with ILT in
					// the future.
					$partPay = 0;
				}
			}
			if (!KlarnaHandler::checkPartpriceCondition ($cData, $cart)) {
				$partPay = 0;
			}

			if ($partPay > 0) {
				if ($payment_params = $payments->get_payment_params ($method, 'part', $cart, $cData['virtuemart_currency_id'], $cData['vendor_currency'])) {
					$payment_form = $this->renderByLayout ('payment_form', array('payment_params' => $payment_params, 'payment_currency_info'       => $payment_params['payment_currency_info'],), 'klarna', 'payment');
					$selected = ($klarna_paymentmethod == 'klarna_part' AND $method->virtuemart_paymentmethod_id == $cart->virtuemart_paymentmethod_id) ? $checked : "";
					$html .= $this->renderByLayout ('displaypayment', array(
						'stype'                       => 'part',
						'id'                          => $payment_params['id'],
						'module'                      => $payment_params['module'],
						'klarna_form'                 => $payment_form,
						'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id,
						'klarna_paymentmethod'        => $klarna_paymentmethod,
						'selected'                    => $selected
					));
				}
			}
		}
		// not tested yet
		/*
		if ( $specCamp > 0) {
			if ($payment_params = $payments->get_payment_params ($method, 'spec', $cart, $cData['virtuemart_currency_id'])) {
				$payment_form = $this->renderByLayout ('payment_form', array('payment_params' => $payment_params, 'payment_currency_info'       => $payment_params['payment_currency_info'],), 'klarna', 'payment');
				$selected = ($klarna_paymentmethod == 'klarna_spec' AND $method->virtuemart_paymentmethod_id == $cart->virtuemart_paymentmethod_id) ? $checked : "";
				$html .= $this->renderByLayout ('displaypayment', array(
					'stype'                       => 'spec',
					'id'                          => $payment_params['id'],
					'module'                      => $payment_params['module'],
					'klarna_form'                 => $payment_form,
					'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id,
					'klarna_paymentmethod'        => $klarna_paymentmethod,
					'selected'                    => $selected
				));
			}
		}
		*/
		return $html;
	}
开发者ID:sergy444,项目名称:joomla,代码行数:100,代码来源:klarna.php

示例5: getListFEPayment

 /**
  * @param VirtueMartCart $cart
  * @param                $method
  * @return null|string
  */
 protected function getListFEPayment(VirtueMartCart $cart, $method)
 {
     $cart_currency_code = ShopFunctions::getCurrencyByID($cart->pricesCurrency, 'currency_code_3');
     $this->_getCartAddressCountryCode($cart, $country_code, $countryId);
     if (!($cData = $this->checkCountryCondition($method, $country_code, $cart))) {
         return NULL;
     }
     $pclasses = KlarnaHandler::getPClasses(NULL, KlarnaHandler::getKlarnaMode($method, $cData['country_code_3']), $cData);
     $this->getNbPClasses($pclasses, $specCamp, $partPay);
     $sessionKlarnaData = $this->getKlarnaSessionData();
     $klarna_paymentmethod = "";
     if (isset($sessionKlarnaData->klarna_paymentmethod)) {
         $klarna_paymentmethod = $sessionKlarnaData->klarna_paymentmethod;
     }
     $html = '';
     $checked = 'checked="checked"';
     $payments = new klarna_payments($cData, KlarnaHandler::getShipToAddress($cart));
     $payment_params = $payments->get_payment_params($method, 'invoice', $cart);
     $payment_form = $this->renderByLayout('payment_form', array('payment_params' => $payment_params, 'payment_currency_info' => $payment_params['payment_currency_info']), 'klarna', 'payment');
     $selected = ($klarna_paymentmethod == 'klarna_invoice' and $method->virtuemart_paymentmethod_id == $cart->virtuemart_paymentmethod_id) ? $checked : "";
     $html .= $this->renderByLayout('displaypayment', array('stype' => 'invoice', 'id' => $payment_params['id'], 'module' => $payment_params['module'], 'klarna_form' => $payment_form, 'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id, 'klarna_paymentmethod' => $klarna_paymentmethod, 'selected' => $selected));
     if ($partPay > 0) {
         if ($payment_params = $payments->get_payment_params($method, 'part', $cart, $cData['virtuemart_currency_id'])) {
             $payment_form = $this->renderByLayout('payment_form', array('payment_params' => $payment_params, 'payment_currency_info' => $payment_params['payment_currency_info']), 'klarna', 'payment');
             $selected = ($klarna_paymentmethod == 'klarna_part' and $method->virtuemart_paymentmethod_id == $cart->v) ? $checked : "";
             $html .= $this->renderByLayout('displaypayment', array('stype' => 'part', 'id' => $payment_params['id'], 'module' => $payment_params['module'], 'klarna_form' => $payment_form, 'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id, 'klarna_paymentmethod' => $klarna_paymentmethod, 'selected' => $selected));
         }
     }
     if ($specCamp > 0) {
         if ($payment_params = $payments->get_payment_params($method, 'spec', $cart, $cData['virtuemart_currency_id'])) {
             $payment_form = $this->renderByLayout('payment_form', array('payment_params' => $payment_params, 'payment_currency_info' => $payment_params['payment_currency_info']), 'klarna', 'payment');
             $selected = ($klarna_paymentmethod == 'klarna_spec' and $method->virtuemart_paymentmethod_id == $cart->virtuemart_paymentmethod_id) ? $checked : "";
             $html .= $this->renderByLayout('displaypayment', array('stype' => 'spec', 'id' => $payment_params['id'], 'module' => $payment_params['module'], 'klarna_form' => $payment_form, 'virtuemart_paymentmethod_id' => $method->virtuemart_paymentmethod_id, 'klarna_paymentmethod' => $klarna_paymentmethod, 'selected' => $selected));
         }
     }
     return $html;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:42,代码来源:klarna.php


注:本文中的ShopFunctions::getCurrencyByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。