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


PHP Currency::getCurrencyArray方法代码示例

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


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

示例1: getPaymentMenuoptions

 /**
  * Return HTML code for the payment dropdown menu options
  *
  * If no valid payment is selected, an additional option representing
  * "please choose" is prepended.
  * @param   string  $selectedId     Optional preselected payment ID
  * @param   integer $countryId      Country ID
  * @return  string                  HTML code for the dropdown menu options
  * @global  array   $_ARRAYLANG     Language array
  */
 static function getPaymentMenuoptions($selectedId = 0, $countryId = 0)
 {
     global $_ARRAYLANG;
     if (is_null(self::$arrPayments)) {
         self::init();
     }
     // Get Payment IDs available in the selected country, if any, or all.
     $arrPaymentId = $countryId ? self::getCountriesRelatedPaymentIdArray($countryId, Currency::getCurrencyArray()) : array_keys(self::$arrPayments);
     $arrOption = empty($arrPaymentId[$selectedId]) && count($arrPaymentId) > 1 ? array(0 => $_ARRAYLANG['TXT_SHOP_PLEASE_SELECT']) : array();
     foreach ($arrPaymentId as $id) {
         $arrOption[$id] = self::$arrPayments[$id]['name'];
     }
     return \Html::getOptions($arrOption, $selectedId);
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:24,代码来源:Payment.class.php

示例2: get_payment_menu

 /**
  * Determines the payment ID to be used, if any, stores it in
  * $_SESSION['shop']['paymentId'], and returns the payment dropdown menu.
  * If there is nothing to pay (products or shipping), returns an empty string.
  *
  * - If Cart::needs_shipment() evaluates to true, and Cart::get_price()
  *   is greater than zero:
  *   - If $_SESSION['shop']['paymentId'] is set, it is changed to the value
  *     of the paymentId ID returned in $_POST['paymentId'], if the latter is set.
  *   - Otherwise, sets $_SESSION['shop']['paymentId'] to the first value
  *     found in $arrPaymentId {@see Payment::getCountriesRelatedPaymentIdArray()}
  *     with the country ID found in $_SESSION['shop']['countryId'].
  *   - Returns the payment dropdown menu as returned by
  *     {@see Payment::getPaymentMenu()}.
  * - If no shipment is necessary, or the order amount is zero (or less),
  *   does nothing, but simply returns the empty string.
  * @return  string  Payment dropdown menu, or an empty string
  */
 static function get_payment_menu()
 {
     if (!Cart::needs_shipment() && Cart::get_price() <= 0) {
         $_SESSION['shop']['paymentId'] = null;
         return '';
     }
     if (isset($_POST['paymentId'])) {
         $_SESSION['shop']['paymentId'] = intval($_POST['paymentId']);
     }
     if (empty($_SESSION['shop']['paymentId'])) {
         // Use the first Payment ID
         $arrPaymentId = Payment::getCountriesRelatedPaymentIdArray($_SESSION['shop']['countryId'], Currency::getCurrencyArray());
         $_SESSION['shop']['paymentId'] = current($arrPaymentId);
     }
     return Payment::getPaymentMenu($_SESSION['shop']['paymentId'], "document.forms['shopForm'].submit()", $_SESSION['shop']['countryId']);
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:34,代码来源:Shop.class.php

示例3: tt

    echo tt('Name ISO');
    ?>
</b>: <?php 
    echo $model->name_iso . ' (' . Lang::getISOname($model->name_iso) . ')';
    ?>
	</div>
	<?php 
}
?>

	<div class="rowold">
		<?php 
echo $form->labelEx($model, 'currency_id');
?>
		<?php 
echo $form->dropDownList($model, 'currency_id', Currency::getCurrencyArray(true), array('class' => 'width150'));
?>
		<?php 
echo $form->error($model, 'currency_id');
?>
	</div>

	<?php 
$this->widget('application.modules.lang.components.langFieldWidget', array('model' => $model, 'field' => 'name', 'type' => 'string'));
?>

	<div class="clear"></div>

	<div class="rowold buttons">
		   <?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'icon' => 'ok white', 'label' => $model->isNewRecord ? tc('Add') : tc('Save')));
开发者ID:alexjkitty,项目名称:estate,代码行数:31,代码来源:_form.php

示例4: getPaymentMethods

 /**
  * Get the payment methods based on the country id
  *
  * @param integer $countryId Country ID
  *
  * @return array array of payment methods
  */
 static function getPaymentMethods($countryId = 0)
 {
     if (is_null(self::$arrPayments)) {
         self::init();
     }
     // Get Payment IDs available in the selected country, if any, or all.
     $arrPaymentIds = $countryId ? self::getCountriesRelatedPaymentIdArray($countryId, Currency::getCurrencyArray()) : array_keys(self::$arrPayments);
     if (empty($arrPaymentIds)) {
         return array();
     }
     $paymentMethods = array();
     foreach ($arrPaymentIds as $id) {
         $paymentMethods[$id] = self::$arrPayments[$id]['name'];
     }
     return $paymentMethods;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:23,代码来源:Payment.class.php

示例5: view_settings_currency

 /**
  * The currency settings view
  */
 static function view_settings_currency()
 {
     self::$objTemplate->addBlockfile('SHOP_SETTINGS_FILE', 'settings_block', 'module_shop_settings_currency.html');
     $i = 0;
     foreach (Currency::getCurrencyArray() as $currency) {
         self::$objTemplate->setVariable(array('SHOP_CURRENCY_STYLE' => 'row' . (++$i % 2 + 1), 'SHOP_CURRENCY_ID' => $currency['id'], 'SHOP_CURRENCY_CODE' => $currency['code'], 'SHOP_CURRENCY_SYMBOL' => $currency['symbol'], 'SHOP_CURRENCY_NAME' => $currency['name'], 'SHOP_CURRENCY_RATE' => $currency['rate'], 'SHOP_CURRENCY_INCREMENT' => $currency['increment'], 'SHOP_CURRENCY_ACTIVE' => $currency['active'] ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_CURRENCY_STANDARD' => $currency['default'] ? \Html::ATTRIBUTE_CHECKED : ''));
         self::$objTemplate->parse('shopCurrency');
     }
     $str_js = '';
     foreach (Currency::get_known_currencies_increment_array() as $code => $increment) {
         // This seems like a sensible default for the few unknown ones
         if (!is_numeric($increment)) {
             $increment = 0.01;
         }
         $str_js .= ($str_js ? ',' : '') . '"' . $code . '":"' . $increment . '"';
     }
     self::$objTemplate->setVariable(array('SHOP_CURRENCY_NAME_MENUOPTIONS' => \Html::getOptions(Currency::get_known_currencies_name_array()), 'SHOP_CURRENCY_INCREMENT_JS_ARRAY' => 'var currency_increment = {' . $str_js . '};'));
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:21,代码来源:ShopManager.class.php


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