本文整理汇总了PHP中CitruscartHelperBase::getSessionVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP CitruscartHelperBase::getSessionVariable方法的具体用法?PHP CitruscartHelperBase::getSessionVariable怎么用?PHP CitruscartHelperBase::getSessionVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CitruscartHelperBase
的用法示例。
在下文中一共展示了CitruscartHelperBase::getSessionVariable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: currency
/**
* Formats and converts a number according to currency rules
* As of v0.5.0 is a wrapper
*
* @param unknown_type $amount
* @param unknown_type $currency
* @return unknown_type
*/
public static function currency($amount, $currency = '', $options = '')
{
$currency_selected = CitruscartHelperBase::getSessionVariable('currency_id', Citruscart::getInstance()->get('default_currencyid', 1));
$currency = $currency_selected;
$currency_helper = CitruscartHelperBase::getInstance('Currency');
$amount = $currency_helper->_($amount, $currency, $options);
return $amount;
}
示例2: Copyright
# ------------------------------------------------------------------------
# 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');
Citruscart::load('CitruscartHelperBase', 'helpers._base');
Citruscart::load('CitruscartSelect', 'library.select');
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/tables');
$helper = CitruscartHelperBase::getInstance();
$url = JRoute::_('index.php?option=com_citruscart&view=currency&task=set&return=' . base64_encode(JURI::getInstance()->__toString()), false);
// Check the currently selected currency
$selected = CitruscartHelperBase::getSessionVariable('currency_id', Citruscart::getInstance()->get('default_currencyid', 1));
?>
<div id="mod_citruscart_currency">
<form action="<?php
echo $url;
?>
" method="post" name="currencySwitch">
<?php
// echo JText::_('COM_CITRUSCART_SELECT_CURRENCY').': ';
?>
<?php
$attribs = array('onChange' => 'document.currencySwitch.submit(); ');
?>
<?php
echo CitruscartSelect::currency($selected, 'currency_id', $attribs);