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


PHP i18n::get_intl_currency_symbol方法代码示例

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


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

示例1: action_pay

 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_pay()
 {
     $this->auto_render = FALSE;
     $order_id = $this->request->param('id');
     $order = new Model_Order();
     $order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         // case when selling advert
         if ($order->id_product == Model_Order::PRODUCT_AD_SELL) {
             $paypal_account = $order->ad->paypal_account();
             $currency = i18n::get_intl_currency_symbol();
             if (isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) {
                 $order->amount = $order->amount + $order->ad->cf_shipping;
             }
         } else {
             $paypal_account = core::config('payment.paypal_account');
             $currency = core::config('payment.paypal_currency');
         }
         $paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
         $paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => $paypal_account, 'paypal_currency' => $currency, 'item_name' => $order->description);
         $this->template = View::factory('paypal', $paypal_data);
         $this->response->body($this->template->render());
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->redirect(Route::url('default'));
     }
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:30,代码来源:paypal.php

示例2: defined

<?php

defined('SYSPATH') or die('No direct script access.');
?>

<script type="application/ld+json">
<?php 
$structured_data = ['@context' => 'http://schema.org/', '@type' => 'Product', 'name' => $ad->title];
if ($ad->get_first_image() !== NULL) {
    $structured_data['image'] = $ad->description;
}
if (Core::config('advertisement.description') != FALSE) {
    $structured_data['description'] = $ad->description;
}
if ($ad->price > 0) {
    $structured_data['offers'] = ['@type' => 'Offer', 'priceCurrency' => i18n::get_intl_currency_symbol(), 'price' => $ad->price];
    if (Core::config('payment.stock') and $ad->stock > 0) {
        $structured_data['offers']['availability'] = 'http://schema.org/InStock';
    }
}
if (Core::config('advertisement.reviews') == 1 and $ad->rate !== NULL) {
    $structured_data['aggregateRating'] = ['@type' => 'AggregateRating', 'ratingValue' => $ad->rate];
}
echo json_encode($structured_data);
?>
</script>
开发者ID:ThomWensink,项目名称:openclassifieds2,代码行数:26,代码来源:json-ld.php

示例3: defined

<?php

defined('SYSPATH') or die('No direct script access.');
?>

<script type="application/ld+json">
<?php 
$structured_data = ['@context' => 'http://schema.org/', '@type' => 'Product', 'name' => $ad->title];
if ($ad->get_first_image() !== NULL) {
    $structured_data['image'] = $ad->get_first_image();
}
if (Core::config('advertisement.description') != FALSE) {
    $structured_data['description'] = $ad->description;
}
if ($ad->price > 0) {
    $structured_data['offers'] = ['@type' => 'Offer', 'priceCurrency' => i18n::get_intl_currency_symbol() ? i18n::get_intl_currency_symbol() : 'USD', 'price' => number_format($ad->price, 2, ".", "")];
    if (Core::config('payment.stock') and $ad->stock > 0) {
        $structured_data['offers']['availability'] = 'http://schema.org/InStock';
    }
}
if (Core::config('advertisement.reviews') == 1 and $ad->rate !== NULL) {
    $structured_data['aggregateRating'] = ['@type' => 'AggregateRating', 'ratingValue' => $ad->rate, 'ratingCount' => Model_Review::get_ad_count_rates($ad)];
}
echo json_encode($structured_data);
?>
</script>
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:26,代码来源:json-ld.php


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