public static function getItems() { if (empty(self::$_data)) { $list = array(); $total = 0; $j2params = J2Store::config(); $order = F0FModel::getTmpInstance('Orders', 'J2StoreModel')->initOrder()->getOrder(); $module = JModuleHelper::getModule('mod_j2store_cart'); // Get params and output $params = new JRegistry($module->params); if ($params->get('quantity_count', 1) == 1) { $items = $order->getItems(); if (count($items) > 0) { foreach ($items as $item) { $total += $item->orderitem_quantity; } } } else { $total = $order->getItemCount(); } if ($total) { $list['total'] = $order->order_total; $list['product_count'] = $total; //$html = JText::sprintf('J2STORE_CART_TOTAL', $product_count, J2StorePrices::number($total)); } else { $list['total'] = 0; $list['product_count'] = 0; //$html = JText::_('J2STORE_NO_ITEMS_IN_CART'); } self::$_data = $list; } return self::$_data; }