Esempio n. 1
0
 * @author David Deutsch <*****@*****.**> & Team AEC - http://www.valanx.org
 * @license GNU/GPL v.3 http://www.gnu.org/licenses/gpl.html or, at your option, any later version
 */
// Dont allow direct linking
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
require_once JPATH_SITE . '/components/com_acctexp/acctexp.class.php';
$class_sfx = $params->get('moduleclass_sfx', "");
$pretext = $params->get('pretext');
$posttext = $params->get('posttext');
$mode = $params->get('mode', 'abridged');
$button = $params->get('button', 1);
$user = JFactory::getUser();
if ($user->id) {
    $lang = JFactory::getLanguage();
    $lang->load('mod_acctexp_cart', JPATH_SITE);
    $c = aecCartHelper::getCartbyUserid($user->id);
    $metaUser = new metaUser($user->id);
    $cart = $c->getCheckout($metaUser);
    if (empty($c->content)) {
        require JModuleHelper::getLayoutPath('mod_acctexp_cart', $params->get('layout', 'empty'));
    } else {
        switch ($mode) {
            default:
            case 'abridged':
                $quantity = 0;
                $total = 0;
                foreach ($cart as $bid => $bitem) {
                    if (!empty($bitem['obj'])) {
                        $quantity += $bitem['quantity'];
                    } else {
                        $total = $bitem['cost_total'];
Esempio n. 2
0
$properties = array();
$properties['showcheckout'] = false;
// Do not let the user in without a subscription or at least an invoice
if (!$metaUser->hasSubscription && empty($invoiceno)) {
    subscribe($option);
    return;
} elseif (!$metaUser->hasSubscription && !empty($invoiceno)) {
    $properties['showcheckout'] = aecInvoiceHelper::lastUnclearedInvoiceIDbyUserID($metaUser->userid);
}
// Prepare Main Tabs
$tabs = array();
foreach (array('overview', 'invoices') as $fname) {
    $tabs[$fname] = JText::_(strtoupper('aec_subdetails_tab_' . $fname));
}
// If we have a cart, we want to link to it
$cart = aecCartHelper::getCartbyUserid($metaUser->userid);
$properties['hascart'] = $cart->id;
$properties['alert'] = $metaUser->getAlertLevel();
// Load a couple of basic variables
$subscriptions = array();
$pplist = array();
$excludedprocs = array('free', 'error');
$custom = null;
$mi_info = null;
// Start off the processor list with objSubscription
if (!empty($metaUser->objSubscription->type)) {
    $pplist = array($metaUser->objSubscription->type);
}
// The upgrade button might only show on some occasions
$properties['upgrade_button'] = true;
if (!empty($tmpl->cfg['renew_button_never'])) {
Esempio n. 3
0
 public function clearCartItem($item)
 {
     if (empty($this->cartobject)) {
         $this->cartobject = aecCartHelper::getCartbyUserid($this->userid);
     }
     $this->cartobject->action('updateItems', array($item => 0));
 }