本文整理汇总了PHP中EnmasseHelper::getTotalBoughtQtyOfUser方法的典型用法代码示例。如果您正苦于以下问题:PHP EnmasseHelper::getTotalBoughtQtyOfUser方法的具体用法?PHP EnmasseHelper::getTotalBoughtQtyOfUser怎么用?PHP EnmasseHelper::getTotalBoughtQtyOfUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnmasseHelper
的用法示例。
在下文中一共展示了EnmasseHelper::getTotalBoughtQtyOfUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkout
function checkout()
{
JRequest::setVar('view', 'shopcheckout');
$activeGuestBuying = EnmasseHelper::isGuestBuyingEnable();
if (JFactory::getUser()->get('guest') && $activeGuestBuying == false) {
$msg = JText::_('ORDER_PLEASE_LOGIN_BEFORE');
$redirectUrl = base64_encode(JRoute::_("index.php?option=com_enmasse&controller=shopping&task=checkout"));
$link = JRoute::_("index.php?option=com_users&view=login&return=" . $redirectUrl, false);
JFactory::getApplication()->redirect($link, $msg);
} else {
$cart = unserialize(JFactory::getSession()->get('cart'));
if (empty($cart) || $cart->getTotalItem() == 0) {
$msg = JText::_("CART_IS_EMPTY");
$link = JRoute::_("index.php?option=com_enmasse&controller=deal&task=listing", false);
JFactory::getApplication()->redirect($link, $msg);
}
$arTotal = array();
if (JFactory::getUser()->get('id')) {
$arDealId = array();
foreach ($cart->getAll() as $cartItem) {
$arDealId[] = $cartItem->getItem()->id;
}
//get array total quantity of deals
$arTotal = EnmasseHelper::getTotalBoughtQtyOfUser(JFactory::getUser()->get('id'), $arDealId);
}
// check cart item
$this->checkMaxCartItem($cart);
parent::display();
}
}