Example #1
1
 public static function getAdavcedItems()
 {
     if (empty(self::$_items)) {
         $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);
         $items = $order->getItems();
         self::$_items = $items;
     }
     return self::$_items;
 }
Example #2
0
<?php

/*------------------------------------------------------------------------
# mod_j2store_cart - J2 Store Cart
# ------------------------------------------------------------------------
# author    Sasi varna kumar - Weblogicx India http://www.weblogicxindia.com
# copyright Copyright (C) 2014 - 19 Weblogicxindia.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://j2store.org
# Technical Support:  Forum - http://j2store.org/forum/index.html
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once dirname(__FILE__) . '/helper.php';
JFactory::getLanguage()->load('com_j2store', JPATH_SITE);
$moduleclass_sfx = $params->get('moduleclass_sfx', '');
$link_type = $params->get('link_type', 'link');
$list = modJ2StoreCartHelper::getItems();
require JModuleHelper::getLayoutPath('mod_j2store_cart', $params->get('layout', 'default'));
/*------------------------------------------------------------------------
# mod_j2store_cart - J2 Store Cart
# ------------------------------------------------------------------------
# author    Sasi varna kumar - Weblogicx India http://www.weblogicxindia.com
# copyright Copyright (C) 2014 - 19 Weblogicxindia.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://j2store.org
# Technical Support:  Forum - http://j2store.org/forum/index.html
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');
if (!defined('F0F_INCLUDED')) {
    include_once JPATH_LIBRARIES . '/f0f/include.php';
}
require_once dirname(__FILE__) . '/helper.php';
JFactory::getLanguage()->load('com_j2store', JPATH_ADMINISTRATOR);
$moduleclass_sfx = $params->get('moduleclass_sfx', '');
$link_type = $params->get('link_type', 'link');
$currency = J2Store::currency();
$document = JFactory::getDocument();
$ajax_url = JRoute::_('index.php?option=com_j2store&view=carts&task=ajaxmini');
$script = "\r\nif(typeof(j2store) == 'undefined') {\r\n\tvar j2store = {};\r\n}\r\nif(typeof(j2store.jQuery) == 'undefined') {\r\n\tj2store.jQuery = jQuery.noConflict();\r\n}\t\t\r\n(function(\$) {\r\n\t\$(document).bind('after_adding_to_cart', function(element,data, type){\r\n\r\n\t\tvar murl = '{$ajax_url}';\r\n\r\n\t\t\$.ajax({\r\n\t\t\turl : murl,\r\n\t\t\ttype : 'get',\r\n\t\t\tcache : false,\r\n\t\t\tcontentType : 'application/json; charset=utf-8',\r\n\t\t\tdataType : 'json',\r\n\t\t\tsuccess : function(json) {\r\n\t\t\t\tif (json != null && json['response']) {\r\n\t\t\t\t\t\$.each(json['response'], function(key, value) {\r\n\t\t\t\t\t\tif (\$('.j2store_cart_module_' + key).length) {\r\n\t\t\t\t\t\t\t\$('.j2store_cart_module_' + key).each(function() {\r\n\t\t\t\t\t\t\t\t\$(this).html(value);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t});\r\n})(j2store.jQuery);\r\n\t\t";
$document->addScriptDeclaration($script);
$document->addStyleSheet(JUri::root() . 'modules/mod_j2store_cart/css/j2store_cart.css');
$list = modJ2StoreCartHelper::getItems();
$advanced_list = modJ2StoreCartHelper::getAdavcedItems();
$model = F0FModel::getTmpInstance('Carts', 'J2StoreModel');
$checkout_url = $model->getCheckoutUrl();
$custom_css = $params->get('custom_css', '');
$document->addStyleDeclaration(strip_tags($custom_css));
require JModuleHelper::getLayoutPath('mod_j2store_cart', $params->get('layout', 'default'));