本文整理汇总了PHP中oseRegistry::Call方法的典型用法代码示例。如果您正苦于以下问题:PHP oseRegistry::Call方法的具体用法?PHP oseRegistry::Call怎么用?PHP oseRegistry::Call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oseRegistry
的用法示例。
在下文中一共展示了oseRegistry::Call方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToCart
function addToCart($msc_id, $msc_option) {
$cart = oseRegistry::Call('payment')->getInstance('Cart');
$payment_mode = oseMscPublic::getPaymentMode();
$item = array('entry_id' => $msc_id, 'entry_type' => 'msc', 'msc_option' => $msc_option);
$cart->addItem($item['entry_id'], $item['entry_type'], $item);
$cart->updateParams('payment_mode', $payment_mode);
$cart->update();
}
示例2: addToCart
function addToCart() {
$cart = oseRegistry::Call('payment')->getInstance('Cart');
$msc_id = JRequest::getInt('msc_id', 0);
$msc_option = JRequest::getCmd('msc_option', null);
$item = array('entry_id' => $msc_id, 'entry_type' => 'msc', 'msc_option' => $msc_option);
$cart->addItem($item['entry_id'], $item['entry_type'], $item);
$items = $cart->get('items');
$cart->setCartItems($items, 'payment_mode', 'm');
$cart->update();
$session = JFactory::getSession();
$session->set('ose_reg_step', 'cart');
$result = array();
$result['success'] = true;
$result['title'] = 'Done';
$result['content'] = JText::_('Added to Cart') . '!';
$result = oseJson::encode($result);
oseExit($result);
}
示例3: jomsocialRegRedirect
function jomsocialRegRedirect()
{
require_once(JPATH_SITE.DS.'components'.DS.'com_osemsc'.DS.'init.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_osemsc'.DS.'helpers'.DS.'oseMscPublic.php');
$uri = &JFactory::getURI();
$vars['task'] = $uri->getVar( 'task' );
$vars['view'] = $uri->getVar( 'view' );
if(empty($vars['task']))
{
$vars['task'] = JRequest::getCmd('task');
}
if(empty($vars['view']))
{
$vars['view'] = JRequest::getCmd('view');
}
$session =& JFactory::getSession();
if(isset($_SESSION['__XIPT']['SELECTED_PROFILETYPE_ID']))
{
$session->set('pid',$_SESSION['__XIPT']['SELECTED_PROFILETYPE_ID']);
}
$vars['joms_regs'] = ($vars['view'] == 'register' && ( $vars['task'] == 'registerSucess' ));
if($vars['joms_regs'])
{
//$pid = $_SESSION['__XIPT']['SELECTED_PROFILETYPE_ID'];
$pid = $session->get('pid',null);
$db= oseDB :: instance();
$query = "SELECT * FROM `#__osemsc_ext` WHERE `type` = 'jspt'";
$db->setQuery($query);
$objs = $db->loadObjectList();
if(!empty($objs))
{
foreach($objs as $obj)
{
$data = oseJson::decode($obj->params);
if($data->enable && $pid == $data->jspt_id)
{
$msc_id = $obj->id;
break;
}
}
}
$redirect = false;
if(!empty($msc_id))
{
JRequest::setVar('msc_id',$msc_id);
$msc = oseRegistry::call('msc');
$opts = $msc->runAddonAction('panel.payment.getOptions',array(),true,true);
$options = $opts['results'];
if(!empty($options))
{
foreach($options as $option)
{
if(!$option['isFree'] && $option['a3']>0)
{
$msc_option = $option['id'];
$redirect =true;
break;
}
}
}
}
if($redirect)
{
$cart = oseRegistry::Call('payment')->getInstance('Cart');
$payment_mode = oseMscPublic::getPaymentMode();
$item = array('entry_id'=>$msc_id,'entry_type'=>'msc','msc_option'=>$msc_option);
$cart->addItem($item['entry_id'],$item['entry_type'],$item);
//oseExit($cart);
$cart->updateParams('payment_mode',$payment_mode);
$cart->update();
$session = JFactory::getSession();
$session->set('ose_reg_step','cart');
$app = JFactory::getApplication();
$app->redirect( 'index.php?option=com_osemsc&view=register');
}
}
}