本文整理汇总了PHP中CitruscartHelperBase::currency方法的典型用法代码示例。如果您正苦于以下问题:PHP CitruscartHelperBase::currency方法的具体用法?PHP CitruscartHelperBase::currency怎么用?PHP CitruscartHelperBase::currency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CitruscartHelperBase
的用法示例。
在下文中一共展示了CitruscartHelperBase::currency方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
/**
* Method to get content article data for the frontpage
*
* @since 1.5
*/
function getList()
{
$where = array();
$mainframe = JFactory::getApplication();
if (!empty($this->_list)) {
return $this->_list;
}
// Initialize variables
$db = $this->getDBO();
$filter = null;
// Get some variables from the request
// $sectionid = JRequest::getVar( 'sectionid', -1, '', 'int' );
// $redirect = $sectionid;
// $option = JRequest::get( 'option' );
$filter_order = $mainframe->getUserStateFromRequest('userelement.filter_order', 'filter_order', '', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest('userelement.filter_order_Dir', 'filter_order_Dir', '', 'word');
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = $mainframe->getUserStateFromRequest('userelement.limitstart', 'limitstart', 0, 'int');
$search = $mainframe->getUserStateFromRequest('userelement.search', 'search', '', 'string');
$search = JString::strtolower($search);
if (!$filter_order) {
$filter_order = 'tbl.product_id';
}
$order = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
$all = 1;
// Keyword filter
if ($search) {
$where[] = 'LOWER( tbl.product_id ) LIKE ' . $db->q('%' . $db->escape($search, true) . '%', false);
$where[] = 'LOWER( tbl.product_name ) LIKE ' . $db->q('%' . $db->escape($search, true) . '%', false);
}
// Build the where clause of the query
$where = count($where) ? ' WHERE ' . implode(' OR ', $where) : '';
// Get the total number of records
$query = 'SELECT COUNT(tbl.product_id)' . ' FROM #__citruscart_products AS tbl' . $where;
$db->setQuery($query);
$total = $db->loadResult();
// Create the pagination object
jimport('joomla.html.pagination');
$this->_page = new JPagination($total, $limitstart, $limit);
// Get the products
$query = 'SELECT tbl.*, pp.* ' . ' FROM #__citruscart_products AS tbl' . ' LEFT JOIN #__citruscart_productprices pp ON pp.product_id = tbl.product_id ' . $where . $order;
$db->setQuery($query, $this->_page->limitstart, $this->_page->limit);
$this->_list = $db->loadObjectList();
//currency formatting
Citruscart::load('CitruscartHelperBase', 'helpers._base');
foreach ($this->_list as $item) {
$item->product_price = CitruscartHelperBase::currency($item->product_price);
}
// If there is a db query error, throw a HTTP 500 and exit
if ($db->getErrorNum()) {
JError::raiseError(500, $db->stderr());
return false;
}
return $this->_list;
}
示例2:
</label></td>
</tr>
<tr>
<th><a href="<?php
echo $stats->link;
?>
"><?php
echo JText::_('COM_CITRUSCART_LIFETIME_SALES');
?>
</a></th>
<td style="text-align: right;"><?php
echo CitruscartHelperBase::number($stats->lifetime->num, $options_int);
?>
</td>
<td style="text-align: right;"><?php
echo CitruscartHelperBase::number($stats->lifetime->average_daily, $options_decimal);
?>
</td>
<td style="text-align: right;"><label class="label label-warning"><?php
echo CitruscartHelperBase::currency($stats->lifetime->average, '', $options_decimal);
?>
</label></td>
<td style="text-align: right;"><label class="label label-success"><?php
echo CitruscartHelperBase::currency($stats->lifetime->amount, '', $options_decimal);
?>
</label></td>
</tr>
</tbody>
</table>
示例3: sprintf
?>
<?php
if ($this->defines->get('display_credits', '0') && (double) $this->userinfo->credits_total > (double) '0.00') {
?>
<fieldset id="opc-credit-form">
<div id="opc-credit-validation"></div>
<div id="credits_form">
<label for="apply_credit_amount"><?php
echo JText::_('COM_CITRUSCART_STORE_CREDIT');
?>
</label>
<div class="help-block"><?php
echo sprintf(JText::_('COM_CITRUSCART_YOU_HAVE_STORE_CREDIT'), CitruscartHelperBase::currency($this->userinfo->credits_total, $this->defines->get('default_currencyid', '1')));
?>
</div>
<div class="input-append" id="opc-credit-input">
<input class="span2" type="text" id="apply_credit_amount" name="apply_credit_amount" />
<button id="opc-credit-button" class="btn" type="button"><?php
echo JText::_("COM_CITRUSCART_APPLY_CREDIT_TO_ORDER");
?>
</button>
</div>
</div>
<div id='opc-credits'></div>
</fieldset>
<?php
示例4:
<div class='onDisplayProductAttributeOptions_wrapper'>
<?php
echo $this->onDisplayProductAttributeOptions;
?>
</div>
<?php
}
?>
<?php
echo JText::_('COM_CITRUSCART_QUANTITY');
?>
<input type="text" name="quantity" value="1" size="10" />
<br/>
<?php
echo JText::_('COM_CITRUSCART_BASE_PRICE');
?>
: <?php
echo CitruscartHelperBase::currency($row->price);
?>
<br/>
<input type="submit" name="add_to_cart" value="<?php
echo JText::_('COM_CITRUSCART_ADD_TO_ORDER');
?>
" class="btn btn-success" />
<input type="hidden" name="task" id="task" value="addtocart" />
<input type="hidden" name="product_id" value="<?php
echo $row->product_id;
?>
" />
示例5: Copyright
<?php
/*------------------------------------------------------------------------
# com_citruscart - citruscart
# ------------------------------------------------------------------------
# author Citruscart Team - Citruscart http://www.citruscart.com
# copyright Copyright (C) 2014 - 2019 Citruscart.com All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://citruscart.com
# Technical Support: Forum - http://citruscart.com/forum/index.html
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
/*Layout for displaying refreshed total amount.*/
JHTML::_('stylesheet', 'menu.css', 'media/citruscart/css/');
JHtml::_('script', 'media/citruscart/js/citruscart.js', false, false);
JHTML::_('script', 'joomla.javascript.js', 'includes/js/');
Citruscart::load('CitruscartGrid', 'library.grid');
$state = $this->state;
$order = $this->order;
$items = $this->orderitems;
echo CitruscartHelperBase::currency($items);
示例6:
echo $rate['tax'];
?>
,<?php
echo $rate['extra'];
?>
, '<?php
echo $rate['code'];
?>
');" <?php
echo $checked;
?>
/> <?php
echo $rate['name'];
?>
( <?php
echo CitruscartHelperBase::currency($rate['total']);
?>
)<br />
<br/>
<?php
}
} else {
?>
<div class="note">
<?php
echo JText::_('COM_CITRUSCART_NO_SHIPPING_NOTE');
?>
</div>
<?php
}
$setval = false;
示例7:
<div id='applied_credit' style="display: none;"></div>
<div class="reset"></div>
<?php
}
?>
<div id="payment_info" class="address">
<h3><?php
echo JText::_('COM_CITRUSCART_BILLING_INFORMATION');
?>
</h3>
<strong><?php
echo JText::_('COM_CITRUSCART_TOTAL_AMOUNT_DUE');
?>
</strong>:<span id='totalAmountDue'><?php
echo CitruscartHelperBase::currency($this->order->order_total);
?>
</span><br/>
<?php
if (!empty($this->showBilling)) {
?>
<strong><?php
echo JText::_('COM_CITRUSCART_BILLING_ADDRESS');
?>
</strong>:<br/>
<?php
echo $billing_info['first_name'] . " " . $billing_info['last_name'] . "<br/>";
echo $billing_info['address_1'] . ", ";
echo $billing_info['address_2'] ? $billing_info['address_2'] . ", " : "";
echo $billing_info['city'] . ", ";
echo $billing_info['zone_name'] . " ";
示例8: getFilters
function getFilters()
{
$filters = array();
if (!empty($this->_filter_category) && !empty($this->category_current)) {
$catObj = new stdClass();
$catObj->label = JText::_('COM_CITRUSCART_CATEGORY');
$catObj->value = $this->category_current->category_name;
$catObj->link = $this->_link . '&filter_category=';
$filters[] = $catObj;
}
if (!empty($this->_filter_price_from) || !empty($this->_filter_price_to)) {
$priceObj = new stdClass();
$priceObj->label = JText::_('COM_CITRUSCART_PRICE');
$priceObj->value = CitruscartHelperBase::currency($this->_filter_price_from) . ' - ' . CitruscartHelperBase::currency($this->_filter_price_to);
$priceObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_price_from=0&filter_price_to=';
$filters[] = $priceObj;
}
if (!empty($this->_filter_attribute_set)) {
$options = explode(',', $this->_filter_option_set);
$session = JFactory::getSession();
$saveOptions = $session->get('options', array(), 'Citruscart_layered_nav');
$trackOpts = array();
$link = '';
$newOPT = array();
$listPAO = array();
$listPA = array();
if (isset($saveOptions[$this->_filter_category])) {
foreach ($saveOptions[$this->_filter_category] as $saveOption) {
if (in_array($saveOption->productattributeoption_id, $options)) {
$listPAO[] = $saveOption->productattributeoption_id;
$listPA[] = $saveOption->productattribute_id;
$newOPT[$saveOption->productattributeoption_name]->istopa[] = $saveOption->productattribute_id;
$newOPT[$saveOption->productattributeoption_name]->istopao[] = $saveOption->productattributeoption_id;
}
}
}
foreach ($options as $option) {
if (empty($this->_options[$option])) {
continue;
}
$combination = $this->_options[$option]->attributename . '::' . $this->_options[$option]->productattributeoption_name;
if (!in_array($combination, $trackOpts)) {
$trackOpts[] = $combination;
$attriObj = new stdClass();
$attriObj->label = $this->_options[$option]->attributename;
$attriObj->value = $this->_options[$option]->productattributeoption_name;
//create option set
$option_set = array_diff($listPAO, $newOPT[$attriObj->value]->istopao);
//create attribute set
$attribute_set = array_diff($listPA, $newOPT[$attriObj->value]->istopa);
$attriObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_attribute_set=' . implode(',', $attribute_set) . '&filter_option_set=' . implode(',', $option_set);
$filters[] = $attriObj;
}
}
}
if ($this->_filter_rating && $this->_params->get('filter_rating')) {
$ratingObj = new stdClass();
$ratingObj->label = JText::_('COM_CITRUSCART_RATING');
$ratingObj->value = CitruscartHelperProduct::getRatingImage((double) $this->_filter_rating) . ' ' . JText::_('COM_CITRUSCART_AND_UP');
$ratingObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_rating=0';
$filters[] = $ratingObj;
}
if ($this->_multi_mode) {
if (!empty($this->_filter_manufacturer_set)) {
$brandSet = explode(',', $this->_filter_manufacturer_set);
foreach ($brandSet as $brand) {
$brandObj = new stdClass();
$brandObj->label = JText::_('COM_CITRUSCART_MANUFACTURER');
$brandObj->value = $this->brands[$brand];
$brandObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_manufacturer_set=' . implode(',', array_diff($brandSet, array($brand)));
$filters[] = $brandObj;
}
}
} else {
if (!empty($this->_filter_manufacturer)) {
$brandObj = new stdClass();
$brandObj->label = JText::_('COM_CITRUSCART_MANUFACTURER');
$brandObj->value = $this->brands[$this->_filter_manufacturer];
$brandObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_manufacturer=';
$filters[] = $brandObj;
}
}
return $filters;
}
示例9: sprintf
<div class="reset"></div>
<?php
if ($display_credits && isset($this->userinfo)) {
?>
<?php
if ($this->userinfo->credits_total > '0.00') {
?>
<!-- STORE CREDITS -->
<div id="credits_area" class="address">
<div id="credits_form">
<h3><?php
echo JText::_('COM_CITRUSCART_STORE_CREDIT');
?>
</h3>
<div id="credit_help"><?php
echo sprintf(JText::_('COM_CITRUSCART_YOU_HAVE_STORE_CREDIT'), CitruscartHelperBase::currency($this->userinfo->credits_total));
?>
</div>
<div id="credit_message"></div>
<input type="text" name="apply_credit_amount" id="apply_credit_amount" value="" />
<input type="button" name="credit_submit" value="<?php
echo JText::_('COM_CITRUSCART_APPLY_CREDIT_TO_ORDER');
?>
" onClick="CitruscartAddCredit( document.adminForm );"/>
</div>
</div>
<?php
}
?>
<div id='applied_credit' style="display: none;"></div>
<div class="reset"></div>
示例10: Copyright
/*------------------------------------------------------------------------
# com_citruscart
# ------------------------------------------------------------------------
# author Citruscart Team - Citruscart http://www.citruscart.com
# copyright Copyright (C) 2014 Citruscart.com All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://citruscart.com
# Technical Support: Forum - http://citruscart.com/forum/index.html
-------------------------------------------------------------------------*/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
JHtml::_('stylesheet', 'media/citruscart/css/citruscart.css');
Citruscart::load('CitruscartHelperBase', 'helpers._base');
jimport('joomla.html');
?>
<?php
$rates = array();
foreach ($vars->rates as $rate) {
$r = new JObject();
$r->value = $rate->shipping_rate_id;
$r->text = CitruscartHelperBase::currency($rate->shipping_rate_price, $vars->order->currency_id);
$rates[] = $r;
}
?>
<div class="shipping_rates">
<?php
echo JHTML::_('select.radiolist', $rates, 'shipping_rate', array());
?>
</div>
示例11:
<?php
if (strlen($item->manufacturer_name)) {
echo $item->manufacturer_name;
} else {
echo ' - ' . JText::_('COM_CITRUSCART_NO_MANUFACTURER') . ' - ';
}
?>
</td>
<td style="text-align: center;">
<?php
echo $item->count_items;
?>
</td>
<td style="text-align: center;">
<?php
echo CitruscartHelperBase::currency($item->price_total);
?>
</td>
</tr>
<?php
$k = 1 - $k;
?>
<?php
}
?>
<?php
if (!count($items)) {
?>
<tr>
<td colspan="10" align="center">
示例12: foreach
</h4>
<ul id="citruscart_browse_pricerange">
<?php
foreach ($priceRanges as $priceRange) {
?>
<?php
if ($priceRange->total > 0) {
?>
<li>
<a href="<?php
echo JRoute::_($priceRange->link);
?>
">
<span class="refinementLink">
<?php
echo CitruscartHelperBase::currency($priceRange->price_from) . ' - ' . CitruscartHelperBase::currency($priceRange->price_to);
?>
</span>
</a>
<span class="narrowValue">
(<?php
echo $priceRange->total;
?>
)
</span>
</li>
<?php
}
?>
<?php
}
示例13: array
<td class="dashboard_profits_data float-shadow"><h3><?php
echo CitruscartSelect::range($state->stats_interval, 'stats_interval', $attribs);
?>
</h3></td>
<?php
} else {
?>
<td class="dashboard_profits_data float-shadow"><h3><?php
echo CitruscartSelect::range($state->stats_interval, 'stats_interval', $attribs, null, true);
?>
</h3></td>
<?php
}
?>
<td class="dashboard_profits_data float-shadow"><h1><?php
echo CitruscartHelperBase::currency($this->sum);
?>
</h1></td>
<td class="dashboard_profits_data float-shadow"><h1><?php
echo CitruscartHelperBase::number($this->total, array('num_decimals' => '0'));
?>
</h1></td>
<td class="dashboard_profits_data"><h1><?php
echo CitruscartHelperBase::number($this->orderedItems, array('num_decimals' => '0'));
?>
</h1></td>
</tr>
</tbody>
</table>
<div class="section">
示例14:
}
?>
</td>
<td style="text-align: center;">
<a href="<?php
echo $item->link;
?>
">
<?php
echo JText::_($item->credittype_name);
?>
</a>
</td>
<td style="text-align: center;">
<h2 class="badge badge-success"><?php
echo CitruscartHelperBase::currency($item->credit_amount);
?>
</h2>
</td>
<td style="text-align: center;">
<?php
echo JHTML::_('date', $item->created_date, $date_format);
?>
</td>
<td style="text-align: center;">
<?php
echo CitruscartGrid::boolean($item->credit_enabled);
?>
</td>
<td style="text-align: center;">
<?php
示例15:
?>
</th>
</tr>
<?php
}
}
}
break;
case 4:
// All in One Line
if ($row->order_tax) {
?>
<tr>
<th colspan="2" style="text-align: right;">
<?php
if (!empty($this->show_tax)) {
echo JText::_('COM_CITRUSCART_PRODUCT_TAX_INCLUDED') . ":";
} else {
echo JText::_('COM_CITRUSCART_PRODUCT_TAX') . ":";
}
?>
</th>
<th style="text-align: right;"><?php
echo CitruscartHelperBase::currency($row->order_tax);
?>
</th>
</tr>
<?php
}
break;
}