Пример #1
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $Itemid = JRequest::getInt('Itemid');
     $user = JFactory::getUser();
     $session = JFactory::getSession();
     $auth = $session->get('auth');
     if ($user->id || isset($auth['users_info_id']) && $auth['users_info_id'] > 0) {
         $app->Redirect('index.php?option=com_redshop&view=account&Itemid=' . $Itemid);
     }
     $params = $app->getParams('com_redshop');
     JHTML::Script('joomla.javascript.js', 'includes/js/', false);
     JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.metadata.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
     $field = new extraField();
     // Field_section 7 : Customer Registration
     $lists['extra_field_user'] = $field->list_all_field(7);
     // Field_section 8 : Company Address
     $lists['extra_field_company'] = $field->list_all_field(8);
     $this->lists = $lists;
     $this->params = $params;
     parent::display($tpl);
 }
Пример #2
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $order_functions = new order_functions();
     // Extra_field;
     $extra_field = new extraField();
     $task = JRequest::getCmd('task');
     $user = JFactory::getUser();
     $uri = JFactory::getURI();
     // Preform security checks
     $session = JFactory::getSession();
     $auth = $session->get('auth');
     $params = $app->getParams('com_redshop');
     $lists = array();
     if ($user->id) {
         $billingaddresses = $order_functions->getBillingAddress($user->id);
     } elseif (isset($auth['users_info_id']) && $auth['users_info_id']) {
         $model = $this->getModel('account_shipto');
         $billingaddresses = $model->_loadData($auth['users_info_id']);
     } else {
         $app->Redirect('index.php?option=com_redshop&view=login&Itemid=' . JRequest::getInt('Itemid'));
         exit;
     }
     if ($task == 'addshipping') {
         JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
         JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
         $shippingaddresses = $this->get('Data');
         if ($shippingaddresses->users_info_id > 0 && $shippingaddresses->user_id != $billingaddresses->user_id) {
             echo JText::_('COM_REDSHOP_ALERTNOTAUTH');
             return;
         }
         $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shippingaddresses->users_info_id);
         $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shippingaddresses->users_info_id);
         $this->setLayout('form');
     } else {
         $shippingaddresses = $order_functions->getShippingAddress($user->id);
     }
     $this->lists = $lists;
     $this->shippingaddresses = $shippingaddresses;
     $this->billingaddresses = $billingaddresses;
     $this->request_url = $uri->toString();
     $this->params = $params;
     parent::display($tpl);
 }
Пример #3
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     // Request variables
     $params = $app->getParams('com_redshop');
     $task = JRequest::getCmd('task', 'com_redshop');
     $Itemid = JRequest::getInt('Itemid');
     $pid = JRequest::getInt('product_id');
     $layout = JRequest::getCmd('layout');
     $config = new Redconfiguration();
     $pageheadingtag = '';
     $params = $app->getParams('com_redshop');
     $document = JFactory::getDocument();
     JHTML::Stylesheet('colorbox.css', 'components/com_redshop/assets/css/');
     JHTML::Script('jquery.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.colorbox-min.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
     $model = $this->getModel("wishlist");
     $wishlist = $model->getUserWishlist();
     $wish_products = $model->getWishlistProduct();
     $session_wishlists = $model->getWishlistProductFromSession();
     if ($task == 'viewwishlist' || $layout == 'viewwishlist') {
         $this->setlayout('viewwishlist');
         $this->wishlists = $wishlist;
         $this->wish_products = $wish_products;
         $this->wish_session = $session_wishlists;
         $this->params = $params;
         parent::display($tpl);
     } elseif ($task == 'viewloginwishlist') {
         $this->setlayout('viewloginwishlist');
         $this->wishlists = $wishlist;
         $this->params = $params;
         parent::display($tpl);
     } else {
         $this->wish_session = $session_wishlists;
         $this->wishlist = $wishlist;
         $this->params = $params;
         parent::display($tpl);
     }
 }
Пример #4
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     // Request variables
     $params = $app->getParams('com_redshop');
     $document = JFactory::getDocument();
     JHTML::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('fetchscript.css', 'components/com_redshop/assets/css/');
     $pageheadingtag = JText::_('COM_REDSHOP_REDSHOP');
     $model = $this->getModel('giftcard');
     $giftcard_template = $model->getGiftcardTemplate();
     $detail = $this->get('data');
     $this->detail = $detail;
     $this->lists = $lists;
     $this->template = $giftcard_template;
     $this->pageheadingtag = $pageheadingtag;
     $this->params = $params;
     parent::display($tpl);
 }
Пример #5
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $extra_field = new extraField();
     $params = $app->getParams('com_redshop');
     $billingaddresses = $GLOBALS['billingaddresses'];
     if (count($billingaddresses) <= 0) {
         $model = $this->getModel('account_billto');
         $billingaddresses = $model->_initData();
     }
     $user = JFactory::getUser();
     $uri = JFactory::getURI();
     $session = JFactory::getSession();
     $auth = $session->get('auth');
     if (!is_array($auth)) {
         $auth['users_info_id'] = 0;
         $session->set('auth', $auth);
         $auth = $session->get('auth');
     }
     JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
     // Preform security checks
     if ($user->id == 0 && $auth['users_info_id'] == 0) {
         $app->Redirect('index.php?option=com_redshop&view=login&Itemid=' . JRequest::getInt('Itemid'));
         exit;
     }
     $lists['requesting_tax_exempt'] = JHTML::_('select.booleanlist', 'requesting_tax_exempt', 'class="inputbox"', @$billingaddresses->requesting_tax_exempt);
     // Field_section 7 :Customer Address
     $lists['extra_field_user'] = $extra_field->list_all_field(7, @$billingaddresses->users_info_id);
     $lists['extra_field_company'] = $extra_field->list_all_field(8, @$billingaddresses->users_info_id);
     $this->lists = $lists;
     $this->billingaddresses = $billingaddresses;
     $this->request_url = $uri->toString();
     $this->params = $params;
     parent::display($tpl);
 }
Пример #6
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     // Request variables
     $id = JRequest::getInt('id');
     $Itemid = JRequest::getInt('Itemid');
     $pid = JRequest::getInt('pid');
     $params = $app->getParams('com_redshop');
     $pathway = $app->getPathway();
     $document = JFactory::getDocument();
     // Include Javascript
     JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('json.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('scrollable-navig.css', 'components/com_redshop/assets/css/');
     $data = $this->get('data');
     $template = $this->get('template');
     // Next/Prev navigation end
     $this->data = $data;
     $this->template = $template;
     $this->params = $params;
     parent::display($tpl);
 }
Пример #7
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $redTemplate = new Redtemplate();
     $lists = array();
     $uri = JFactory::getURI();
     $params = $app->getParams('com_redshop');
     $document = JFactory::getDocument();
     $layout = JRequest::getCmd('layout', '');
     $model = $this->getModel('search');
     if ($layout == 'default') {
         $pagetitle = JText::_('COM_REDSHOP_SEARCH');
         $document->setTitle($pagetitle);
     }
     $document = JFactory::getDocument();
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     if (AJAX_CART_BOX == 0) {
         JHTML::Script('fetchscript.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
     }
     // Ajax cart javascript
     if (AJAX_CART_BOX == 1) {
         JHTML::Script('fetchscript.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
         JHTML::Stylesheet('fetchscript.css', 'components/com_redshop/assets/css/');
     }
     if ($layout == 'redfilter') {
         $session = JSession::getInstance('none', array());
         $tagid = JRequest::getInt('tagid', 0);
         $typeid = JRequest::getInt('typeid', 0);
         $remove = JRequest::getInt('remove', 0);
         $Itemid = JRequest::getInt('Itemid', 0);
         $cntproduct = JRequest::getInt('cnt', 0);
         $getredfilter = $session->get('redfilter');
         if (count($getredfilter) == 0) {
             $redfilter = array();
         } else {
             $redfilter = $getredfilter;
         }
         if ($tagid != 0 && $typeid != 0 && !array_key_exists($typeid, $redfilter)) {
             $redfilter[$typeid] = $tagid;
         }
         if ($remove == 1) {
             if ($typeid != 0) {
                 unset($redfilter[$typeid]);
                 $session->set('redfilter', $redfilter);
                 $this->setLayout('redfilter');
                 $model->getRedFilterProduct($remove);
                 echo $model->mod_redProductfilter($Itemid, $typeid) . '~';
             } else {
                 $session->destroy('redfilter');
             }
         }
         $session->set('redfilter', $redfilter);
         if ($cntproduct == 1) {
             $mypid = JRequest::getInt('pid', 0);
             $app->Redirect('index.php?option=com_redshop&view=product&pid=' . $mypid . '&Itemid=' . $Itemid);
         }
     }
     $redHelper = new redhelper();
     $order_data = $redHelper->getOrderByList();
     $getorderby = JRequest::getString('order_by', DEFAULT_PRODUCT_ORDERING_METHOD);
     $lists['order_select'] = JHTML::_('select.genericlist', $order_data, 'order_by', 'class="inputbox" size="1" onchange="document.orderby_form.submit();" ', 'value', 'text', $getorderby);
     $templatedata = $model->getCategoryTemplet();
     for ($i = 0; $i < 1; $i++) {
         $templatedata[$i]->template_desc = $redTemplate->readtemplateFile($templatedata[$i]->template_section, $templatedata[$i]->template_name);
     }
     $search = $this->get('Data');
     $pagination = $this->get('Pagination');
     $this->params = $params;
     $this->limit = $model->getState('limit');
     $this->lists = $lists;
     $this->templatedata = $templatedata;
     $this->search = $search;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Пример #8
0
        /**
         * Display Product Data
         */
        function displayredManufacturer($limit = 0)
        {
            $uri = JUri::getInstance();
            $url = $uri->root();
            $database = JFactory::getDbo();
            $Itemid = JRequest::getInt('Itemid', 0);
            $extra_data = new producthelper();
            $document = JFactory::getDocument();
            JHTML::Script('jquery-1.js', 'modules/mod_redmanufacturer/js/', false);
            JHTML::Script('jquery.js', 'modules/mod_redmanufacturer/js/', false);
            JHTML::Stylesheet('jquery.css', 'modules/mod_redmanufacturer/css/');
            echo $this->params->get('pretext', "");
            $qlimit = "";
            if ($limit > 0) {
                $qlimit = "LIMIT {$limit}";
            }
            $query = "SELECT m.media_name,ma.manufacturer_name,ma.manufacturer_id FROM #__redshop_manufacturer as ma " . "LEFT JOIN #__redshop_media AS m ON m.`section_id`=ma.manufacturer_id " . "WHERE m.media_section='manufacturer' " . "AND m.published=1 " . "AND ma.published=1 " . $qlimit;
            $database->setQuery($query);
            $rows = $database->loadObjectList();
            ?>

	<script type="text/javascript">
		var dom1 = {};
		dom1.query = jQuery.noConflict(true);
		var mycarousel_itemList = [
			<?php 
            for ($i = 0; $i < count($rows); $i++) {
                $thumbUrl = RedShopHelperImages::getImagePath($rows[$i]->media_name, '', 'thumb', 'manufacturer', $this->ImageWidth, $this->ImageHeight, USE_IMAGE_SIZE_SWAPPING);
                ?>
			{url: "<?php 
                echo $thumbUrl;
                ?>
", title: '<?php 
                echo $rows[$i]->manufacturer_name;
                ?>
', ahref: '<a href="<?php 
                echo JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=' . $this->PageLink . '&mid=' . $rows[$i]->manufacturer_id . '&Itemid=' . $Itemid);
                ?>
"  title="<?php 
                echo $rows[$i]->manufacturer_name;
                ?>
">'}
			<?php 
                if ($i < count($rows) - 1) {
                    ?>
			,
			<?php 
                }
            }
            ?>
		];

		function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt) {
			// The index() method calculates the index from a
			// given index who is out of the actual item range.

			var idx = carousel.index(i, mycarousel_itemList.length);
			carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
		}
		;

		function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt) {
			carousel.remove(i);
		}
		;

		/**
		 * Item html creation helper.
		 */
		function mycarousel_getItemHTML(item) {
			var displayItem = '';
			<?php 
            if ($this->show_image == 1) {
                ?>
			displayItem = displayItem + item.ahref + '<img src="' + item.url + '" width="<?php 
                echo $this->ImageWidth;
                ?>
" height="<?php 
                echo $this->ImageHeight;
                ?>
" alt="' + item.title + '" /></a><br/>';
			<?php 
            }
            if ($this->show_link_on_product_name == 1) {
                ?>
			displayItem = displayItem + item.ahref;

			<?php 
            }
            if ($this->show_product_name == 1) {
                ?>
			displayItem = displayItem + '<div align="center">' + item.title + '</div>';
			<?php 
            }
            if ($this->show_link_on_product_name == 1) {
                ?>
			displayItem = displayItem + '</a>';

			<?php 
            }
            ?>

			return displayItem;
		}
		;

		function mycarousel_initCallback(carousel, item, i, state, evt) {
			var idx = carousel.index(i, mycarousel_itemList.length);
			carousel.startAuto(idx);
		}
		;

		dom1.query(function () {
			dom1.query('#mycarousel').jcarousel({
				wrap: '<?php 
            echo $this->ScrollWrap;
            ?>
',
				scroll:<?php 
            echo $this->ScrollBehavior;
            ?>
,
				auto:<?php 
            echo $this->ScrollAuto;
            ?>
,
				animation: '<?php 
            echo $this->ScrollDelay;
            ?>
',
				vertical:<?php 
            echo $this->ScrollDirection;
            ?>
,
				itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
				itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},
				itemLastOutCallback: mycarousel_initCallback
			});
		});
	</script>
	<style type="text/css">
		.jcarousel-skin-tango .jcarousel-container {

		}

		.jcarousel-skin-tango .jcarousel-container-horizontal {
			width: <?php 
            echo $this->ScrollWidth + 10;
            ?>
px; /* Default 140 Aspect 1 image */
			height: <?php 
            echo $this->ScrollHeight + 10;
            ?>
px; /* Default 140 Aspect 1 image */
			padding-top: 10px;
			padding-bottom: 10px;
			padding-left: 0px;
			padding-right: 0px;
		}

			/* For vertical scrolling */
		.jcarousel-skin-tango .jcarousel-container-vertical {
			width: <?php 
            echo $this->ScrollWidth + 10;
            ?>
px;
			height: <?php 
            echo $this->ScrollHeight + 10;
            ?>
px;
			padding: 10px 10px;

		}

		.jcarousel-skin-tango .jcarousel-clip-horizontal {
			width: <?php 
            echo $this->ScrollWidth;
            ?>
px; /* Default 130 Aspect 1 image change acording to params */
			height: <?php 
            echo $this->ScrollHeight;
            ?>
px; /* Default 120 Aspect 1 image change acording to params */

		}

			/* For vertical scrolling */
		.jcarousel-skin-tango .jcarousel-clip-vertical {
			width: <?php 
            echo $this->ScrollWidth;
            ?>
px;
			height: <?php 
            echo $this->ScrollHeight;
            ?>
px;
		}

		.jcarousel-skin-tango .jcarousel-item {

			padding: 5px;
			width: <?php 
            echo $this->ImageWidth;
            ?>
px; /* Default image width */
			height: <?php 
            echo $this->ImageHeight + 25;
            ?>
px; /* Default image height */
		<?php 
            if ($this->ImageBorder == 'yes') {
                ?>
 border: 1px solid;
		<?php 
            }
            ?>
		}

		.jcarousel-skin-tango .jcarousel-item:hover {
			background-position: 0px -90px;
			cursor: pointer;
		}

		.jcarousel-skin-tango .jcarousel-item-horizontal {
			margin-right: 20px;
		}

			/* For vertical scrolling */
		.jcarousel-skin-tango .jcarousel-item-vertical {
			margin-bottom: 20px;
		}

		.jcarousel-skin-tango .jcarousel-item-placeholder {
			color: #000;
		}

	</style>
	<div class="jcarousel-skin-tango">
		<div style="display: block;" class="jcarousel-container jcarousel-container-horizontal">
			<div>
				<ul id="mycarousel" class="jcarousel-list jcarousel-list-horizontal">
					<?php 
            for ($i = 0; $i < count($rows); $i++) {
                $thumbUrl = RedShopHelperImages::getImagePath($rows[$i]->media_name, '', 'thumb', 'manufacturer', 100, 100, USE_IMAGE_SIZE_SWAPPING);
                ?>
						<li jcarouselindex="<?php 
                echo $i + 31;
                ?>
"
						    class="jcarousel-item jcarousel-item-horizontal jcarousel-item-<?php 
                echo $i + 31;
                ?>
 jcarousel-item-<?php 
                echo $i + 31;
                ?>
-horizontal">
							<a href='<?php 
                echo $url;
                ?>
index.php?option=com_redshop&view=manufacturers&layout=<?php 
                echo $this->PageLink;
                ?>
&mid=<?php 
                echo $rows[$i]->manufacturer_id;
                ?>
&Itemid=<?php 
                echo $Itemid;
                ?>
'
							   title='<?php 
                echo $rows[$i]->manufacturer_name;
                ?>
'>
							   <img src='<?php 
                echo $thumbUrl;
                ?>
' alt='<?php 
                echo $rows[$i]->media_name;
                ?>
' width='100' height='100'>
							</a>
						</li>

					<?php 
            }
            ?>
				</ul>

			</div>
		</div>
	</div>
<?php 
        }
Пример #9
0
require_once JPATH_COMPONENT . '/helpers/product.php';
require_once JPATH_COMPONENT . '/helpers/currency.php';
// Helper object
$helper = new redhelper();
// Include redCRM if required
$helper->isredCRM();
$print = JRequest::getCmd('print');
// Adding Redshop CSS
$doc = JFactory::getDocument();
// Use diffrent CSS for print layout
if (!$print) {
    JHTML::Stylesheet('redshop.css', 'components/com_redshop/assets/css/');
} else {
    JHTML::Stylesheet('print.css', 'components/com_redshop/assets/css/');
}
JHTML::Stylesheet('style.css', 'components/com_redshop/assets/css/');
$Itemid = $helper->getCheckoutItemid();
$Itemid = JRequest::getInt('Itemid', $Itemid);
$Itemid = $helper->getCartItemid();
// Include redshop js file.
require_once JPATH_COMPONENT . '/helpers/redshop.js.php';
$controller = JRequest::getCmd('view', 'category');
$task = JRequest::getCmd('task');
$format = JRequest::getWord('format', '');
$layout = JRequest::getWord('layout', '');
$params = $app->getParams('com_redshop');
// Add product in cart from db
$helper->dbtocart();
$categoryid = JRequest::getInt('cid', $params->get('categoryid'));
$productid = JRequest::getInt('pid', 0);
$sgportal = $helper->getShopperGroupPortal();
Пример #10
0
        $jscook_tree = "ctThemeXP1";
    }
    if ($jscookTree_style == "ThemeNavy") {
        $jscook_tree = "ctThemeNavy";
    }
    JHTML::Script('JSCookTree.js', $js_src . '/', false);
    JHTML::Script('theme.js', $js_src . '/' . $jscookTree_style . '/', false);
    JHTML::Stylesheet('theme.css', $js_src . '/' . $jscookTree_style . '/');
    $_jscook = new redCategoryMenu();
} else {
    //JHTML::Script('JSCookMenu.js', $urlpath.'includes/js/',false);
    //JHTML::Script('theme.js', $urlpath.'includes/js/'.$jscookMenu_style.'/',false);
    //JHTML::Stylesheet('theme.css', $urlpath.'includes/js/'.$jscookMenu_style.'/');
    JHTML::Script('JSCookMenu.js', $js_src . '/JSCook/', false);
    JHTML::Script('theme.js', $js_src . '/JSCook/', false);
    JHTML::Stylesheet('theme.css', $js_src . '/JSCook/');
    $_jscook = new redCategoryMenu();
}
// create a unique tree identifier, in case multiple trees are used
// (max one per module)
$varname = "JSCook_" . uniqid($jscook_type . "_");
$menu_htmlcode = '<div align="left" class="mainlevel" id="div_' . $varname . '"></div>
<script type="text/javascript">
//<!--
function ' . $varname . '_addEvent( obj, type, fn )
{
   if (obj.addEventListener) {
      obj.addEventListener( type, fn, false );
   } else if (obj.attachEvent) {
      obj["e"+type+fn] = fn;
      obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
Пример #11
0
 public function display($tpl = null)
 {
     global $context;
     $app = JFactory::getApplication();
     $prodhelperobj = new producthelper();
     $prodhelperobj->generateBreadcrumb();
     $Itemid = JRequest::getInt('Itemid');
     $layout = JRequest::getCmd('layout');
     $params = $app->getParams('com_redshop');
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $user = JFactory::getUser();
     $userdata = $model->getuseraccountinfo($user->id);
     if (!count($userdata) && $layout != 'mywishlist') {
         $msg = JText::_('COM_REDSHOP_LOGIN_USER_IS_NOT_REDSHOP_USER');
         $app->Redirect("index.php?option=com_redshop&view=account_billto&Itemid=" . $Itemid, $msg);
     }
     $layout = JRequest::getCmd('layout', 'default');
     $mail = JRequest::getInt('mail');
     // Preform security checks
     if ($user->id == 0 && $layout != 'mywishlist' || $user->id == 0 && $layout == 'mywishlist' && !isset($mail)) {
         $app->Redirect('index.php?option=com_redshop&view=login&Itemid=' . JRequest::getInt('Itemid'));
         return;
     }
     if ($layout == 'mytags') {
         JLoader::import('joomla.html.pagination');
         $this->setLayout('mytags');
         $remove = JRequest::getInt('remove', 0);
         if ($remove == 1) {
             $model->removeTag();
         }
         $maxcategory = $params->get('maxcategory', 5);
         $limit = $app->getUserStateFromRequest($context . 'limit', 'limit', $maxcategory, 5);
         $limitstart = JRequest::getInt('limitstart', 0, '', 'int');
         $total = $this->get('total');
         $pagination = new redPagination($total, $limitstart, $limit);
         $this->pagination = $pagination;
     }
     if ($layout == 'mywishlist') {
         $wishlist_id = $app->input->getInt('wishlist_id', 0);
         // If wishlist Id is not set then redirect to it's main page
         if ($wishlist_id == 0) {
             $app->Redirect("index.php?option=com_redshop&view=wishlist&layout=viewwishlist&Itemid=" . $Itemid);
         }
         JLoader::import('joomla.html.pagination');
         JHTML::Stylesheet('colorbox.css', 'components/com_redshop/assets/css/');
         JHTML::Script('jquery.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('jquery.colorbox-min.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
         JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
         $this->setLayout('mywishlist');
         $remove = JRequest::getInt('remove', 0);
         if ($remove == 1) {
             $model->removeWishlistProduct();
         }
         $maxcategory = $params->get('maxcategory', 5);
         $limit = $app->getUserStateFromRequest($context . 'limit', 'limit', $maxcategory, 5);
         $limitstart = JRequest::getInt('limitstart', 0, '', 'int');
         $total = $this->get('total');
         $pagination = new redPagination($total, $limitstart, $limit);
         $this->pagination = $pagination;
     }
     if ($layout == 'compare') {
         $remove = JRequest::getInt('remove', 0);
         if ($remove == 1) {
             $model->removeCompare();
         }
         JLoader::import('joomla.html.pagination');
         $this->setLayout('compare');
     }
     $this->user = $user;
     $this->userdata = $userdata;
     $this->params = $params;
     // RedCRM Template
     // Helper object
     $helper = new redhelper();
     if ($layout == "default" && $helper->isredCRM()) {
         $tmplPath = JPATH_BASE . '/components/com_redcrm/views/account/tmpl';
         $this->addTemplatePath($tmplPath);
         parent::display('storemanagement');
     }
     // RedCRM Template END
     parent::display($tpl);
 }
Пример #12
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $producthelper = new producthelper();
     $redhelper = new redhelper();
     $document = JFactory::getDocument();
     $print = JRequest::getInt('print');
     $layout = JRequest::getCmd('layout', 'default');
     $params = $app->getParams('com_redshop');
     $Itemid = $app->input->getInt('itemid', null);
     $mid = 0;
     $lists = array();
     $model = $this->getModel('manufacturers');
     $detail = $this->get('data');
     $limit = $params->get('maxproduct');
     if (!$limit && $detail) {
         $limit = $detail[0]->product_per_page;
     }
     $model->setProductLimit($limit);
     $pageheadingtag = '';
     $disabled = "";
     if ($print) {
         $disabled = "disabled";
     }
     JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('fetchscript.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('fetchscript.css', 'components/com_redshop/assets/css/');
     if ($layout != 'default') {
         $manufacturer = $detail[0];
         $mid = $manufacturer->manufacturer_id;
         if ($manufacturer->manufacturer_id) {
             $document->setMetaData('robots', $manufacturer->metarobot_info);
             // For page title
             if (AUTOGENERATED_SEO && SEO_PAGE_TITLE_MANUFACTUR != '') {
                 $pagetitletag = SEO_PAGE_TITLE_MANUFACTUR;
                 $pagetitletag = str_replace("{manufacturer}", $manufacturer->manufacturer_name, $pagetitletag);
                 $pagetitletag = str_replace("{shopname}", SHOP_NAME, $pagetitletag);
             }
             if ($manufacturer->pagetitle != '' && AUTOGENERATED_SEO && SEO_PAGE_TITLE_MANUFACTUR != '') {
                 $pagetitletag = $pagetitletag . " " . $manufacturer->pagetitle;
                 $document->setTitle($pagetitletag);
             } else {
                 if ($manufacturer->pagetitle != '') {
                     $pagetitletag = $manufacturer->pagetitle;
                     $document->setTitle($manufacturer->pagetitle);
                 } elseif (AUTOGENERATED_SEO && SEO_PAGE_TITLE_MANUFACTUR != '') {
                     $document->setTitle($pagetitletag);
                 } else {
                     $pagetitletag = $app->getCfg('sitename');
                     $document->setTitle($app->getCfg('sitename'));
                 }
             }
             if ($layout == 'products') {
                 $pagetitletag = JText::_("COM_REDSHOP_MANUFACTURER_PRODUCT") . " " . $pagetitletag;
                 $document->setTitle($pagetitletag);
             }
             // For meta keyword
             if (AUTOGENERATED_SEO && SEO_PAGE_KEYWORDS_MANUFACTUR != '') {
                 $pagekeywordstag = SEO_PAGE_KEYWORDS_MANUFACTUR;
                 $pagekeywordstag = str_replace("{manufacturer}", $manufacturer->manufacturer_name, $pagekeywordstag);
                 $pagekeywordstag = str_replace("{shopname}", SHOP_NAME, $pagekeywordstag);
             }
             if ($manufacturer->metakey != '' && AUTOGENERATED_SEO && SEO_PAGE_KEYWORDS_MANUFACTUR != '') {
                 $pagekeywordstag = $pagekeywordstag . ", " . $manufacturer->metakey;
                 $document->setMetaData('keywords', $pagekeywordstag);
             } else {
                 if ($manufacturer->metakey != '') {
                     $document->setMetaData('keywords', $manufacturer->metakey);
                 } elseif (AUTOGENERATED_SEO && SEO_PAGE_KEYWORDS_MANUFACTUR != '') {
                     $document->setMetaData('keywords', $pagekeywordstag);
                 } else {
                     $document->setMetaData('keywords', $manufacturer->manufacturer_name);
                 }
             }
             // For meta description
             if (AUTOGENERATED_SEO && SEO_PAGE_DESCRIPTION_MANUFACTUR != '') {
                 $pagedesctag = SEO_PAGE_DESCRIPTION_MANUFACTUR;
                 $pagedesctag = str_replace("{manufacturer}", $manufacturer->manufacturer_name, $pagedesctag);
                 $pagedesctag = str_replace("{shopname}", SHOP_NAME, $pagedesctag);
             }
             if ($manufacturer->metadesc != '' && AUTOGENERATED_SEO && SEO_PAGE_DESCRIPTION_MANUFACTUR != '') {
                 $pagedesctag = $pagedesctag . " " . $manufacturer->metadesc;
                 $document->setMetaData('description', $pagedesctag);
             } else {
                 if ($manufacturer->metadesc != '') {
                     $document->setMetaData('description', $manufacturer->metadesc);
                 } elseif (AUTOGENERATED_SEO && SEO_PAGE_DESCRIPTION_MANUFACTUR != '') {
                     $document->setMetaData('description', $pagedesctag);
                 } else {
                     $document->setMetaData('description', $manufacturer->manufacturer_name);
                 }
             }
             if ($manufacturer->metarobot_info != '') {
                 $document->setMetaData('robots', $manufacturer->metarobot_info);
             } else {
                 if (AUTOGENERATED_SEO && SEO_PAGE_ROBOTS != '') {
                     $pagerobotstag = SEO_PAGE_ROBOTS;
                     $document->setMetaData('robots', $pagerobotstag);
                 } else {
                     $document->setMetaData('robots', "INDEX,FOLLOW");
                 }
             }
             // For page heading
             if (AUTOGENERATED_SEO && SEO_PAGE_HEADING_MANUFACTUR != '') {
                 $pageheadingtag = SEO_PAGE_HEADING_MANUFACTUR;
                 $pageheadingtag = str_replace("{manufacturer}", $manufacturer->manufacturer_name, $pageheadingtag);
             }
             if (trim($manufacturer->pageheading) != '' && AUTOGENERATED_SEO && SEO_PAGE_HEADING_MANUFACTUR != '') {
                 $pageheadingtag = $pageheadingtag . " " . $manufacturer->pageheading;
             } else {
                 if (trim($manufacturer->pageheading) != '') {
                     $pageheadingtag = $manufacturer->pageheading;
                 } elseif (AUTOGENERATED_SEO && SEO_PAGE_HEADING_MANUFACTUR != '') {
                     $pageheadingtag = $pageheadingtag;
                 }
             }
             // FOr Canonical In Manufacturer Page
             if (AUTOGENERATED_SEO && SEO_PAGE_CANONICAL_MANUFACTUR != '' && $layout != "products") {
                 $canonicalurl = SEO_PAGE_CANONICAL_MANUFACTUR;
                 $manufacturer_products_url = substr_replace(JURI::root(), "", -1) . JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=products&mid=' . $manufacturer->manufacturer_id . '&Itemid=' . $Itemid);
                 $canonicalurl_content = '<link rel="canonical" href="' . $manufacturer_products_url . '" />';
                 $canonicalurl = str_replace("{manufacturerproductslink}", $canonicalurl_content, $canonicalurl);
                 $document->addCustomTag($canonicalurl);
             }
         } else {
             $document->setMetaData('keywords', $app->getCfg('sitename'));
             $document->setMetaData('description', $app->getCfg('sitename'));
             $document->setMetaData('robots', $app->getCfg('sitename'));
         }
         $this->setLayout($layout);
     }
     // Breadcrumbs
     $producthelper->generateBreadcrumb($mid);
     // Breadcrumbs end
     if ($layout == "products") {
         $order_by_select = JRequest::getString('order_by', DEFAULT_MANUFACTURER_PRODUCT_ORDERING_METHOD);
         $order_data = $redhelper->getOrderByList();
     } else {
         $order_by_select = JRequest::getString('order_by', DEFAULT_MANUFACTURER_ORDERING_METHOD);
         $order_data = $redhelper->getManufacturerOrderByList();
     }
     $lists['order_select'] = JHTML::_('select.genericlist', $order_data, 'order_by', 'class="inputbox" size="1" onchange="document.orderby_form.submit();" ' . $disabled . ' ', 'value', 'text', $order_by_select);
     $categorylist = $model->getCategoryList();
     $temps = array();
     $temps[0] = new StdClass();
     $temps[0]->value = "0";
     $temps[0]->text = JText::_('COM_REDSHOP_SELECT');
     $categorylist = array_merge($temps, $categorylist);
     $filter_by_select = JRequest::getString('filter_by', 0);
     $lists['filter_select'] = JHTML::_('select.genericlist', $categorylist, 'filter_by', 'class="inputbox" size="1" onchange="document.filter_form.submit();" ' . $disabled . ' ', 'value', 'text', $filter_by_select);
     $pagination = $this->get('Pagination');
     $this->detail = $detail;
     $this->lists = $lists;
     $this->pagination = $pagination;
     $this->pageheadingtag = $pageheadingtag;
     $this->params = $params;
     parent::display($tpl);
 }
Пример #13
0
JHTML::_('behavior.modal');
$uri = JURI::getInstance();
$url = $uri->root();
$Itemid = JRequest::getInt('Itemid');
$user = JFactory::getUser();
$option = 'com_redshop';
$document = JFactory::getDocument();
$document->addStyleSheet('modules/mod_redshop_products/css/products.css');
// Include redshop js file.
require_once JPATH_SITE . '/components/com_redshop/helpers/redshop.js.php';
JLoader::import('images', JPATH_ADMINISTRATOR . '/components/com_redshop/helpers');
// Lightbox Javascript
JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false);
JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
JHTML::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
JHTML::Stylesheet('fetchscript.css', 'components/com_redshop/assets/css/');
$producthelper = new producthelper();
$redhelper = new redhelper();
$redTemplate = new Redtemplate();
$extraField = new extraField();
$stockroomhelper = new rsstockroomhelper();
$config = new Redconfiguration();
$module_id = "mod_" . $module->id;
echo "<div id='" . $module_id . "' class='mod_redshop_products_wrapper'>";
for ($i = 0; $i < count($rows); $i++) {
    $row = $rows[$i];
    if ($show_stockroom_status == 1) {
        $isStockExists = $stockroomhelper->isStockExists($row->product_id);
        if (!$isStockExists) {
            $isPreorderStockExists = $stockroomhelper->isPreorderStockExists($row->product_id);
        }
Пример #14
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $model = $this->getModel('checkout');
     $Itemid = JRequest::getInt('Itemid');
     $task = JRequest::getCmd('task');
     $user = JFactory::getUser();
     $redhelper = new redhelper();
     $field = new extraField();
     $session = JFactory::getSession();
     // Load language file
     $payment_lang_list = $redhelper->getPlugins("redshop_payment");
     $language = JFactory::getLanguage();
     $base_dir = JPATH_ADMINISTRATOR;
     $language_tag = $language->getTag();
     for ($l = 0; $l < count($payment_lang_list); $l++) {
         $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element;
         $language->load($extension, $base_dir, $language_tag, true);
     }
     JHTML::Script('joomla.javascript.js', 'includes/js/', false);
     JHTML::Script('validate.js', 'media/system/js/', false);
     JHTML::Script('jquery-1.4.2.min.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.validate.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('jquery.metadata.js', 'components/com_redshop/assets/js/', false);
     JHTML::Script('registration.js', 'components/com_redshop/assets/js/', false);
     JHTML::Stylesheet('validation.css', 'components/com_redshop/assets/css/');
     JHTML::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
     if (JPluginHelper::isEnabled('redshop_veis_registration', 'rs_veis_registration')) {
         JHTML::Script('veis.js', 'plugins/redshop_veis_registration/rs_veis_registration/js/', false);
     }
     $cart = $session->get('cart');
     $auth = $session->get('auth');
     if (!is_array($auth)) {
         $auth['users_info_id'] = 0;
         $session->set('auth', $auth);
         $auth = $session->get('auth');
     }
     if ($cart['idx'] < 1) {
         $msg = JText::_('COM_REDSHOP_EMPTY_CART');
         $link = 'index.php?option=com_redshop&Itemid=' . $Itemid;
         $app->Redirect($link, $msg);
     }
     $lists = array();
     if ($task != '') {
         $tpl = $task;
     } else {
         if ($user->id || $auth['users_info_id'] > 0) {
             $cart = $session->get('cart');
             if (DEFAULT_QUOTATION_MODE == 1 && !array_key_exists("quotation_id", $cart)) {
                 $app->Redirect('index.php?option=com_redshop&view=quotation&Itemid=' . $Itemid);
             }
             $users_info_id = JRequest::getInt('users_info_id');
             $billingaddresses = $model->billingaddresses();
             $shippingaddresses = $model->shippingaddresses();
             if (!$users_info_id) {
                 if ((!isset($users_info_id) || $users_info_id == 0) && count($shippingaddresses) > 0) {
                     $users_info_id = $shippingaddresses[0]->users_info_id;
                 } elseif ((!isset($users_info_id) || $users_info_id == 0) && count($billingaddresses) > 0) {
                     $users_info_id = $billingaddresses->users_info_id;
                 } else {
                     $app->Redirect("index.php?option=com_redshop&view=account_billto&Itemid=" . $Itemid);
                 }
             }
             $shipping_rate_id = JRequest::getInt('shipping_rate_id');
             $element = JRequest::getCmd('payment_method_id');
             $ccinfo = JRequest::getInt('ccinfo');
             $total_discount = $cart['cart_discount'] + $cart['voucher_discount'] + $cart['coupon_discount'];
             $subtotal = SHIPPING_AFTER == 'total' ? $cart['product_subtotal'] - $total_discount : $cart['product_subtotal'];
             $this->users_info_id = $users_info_id;
             $this->shipping_rate_id = $shipping_rate_id;
             $this->element = $element;
             $this->ccinfo = $ccinfo;
             $this->order_subtotal = $subtotal;
             $this->ordertotal = $cart['total'];
         } else {
             // Field_section 6 : Customer Registration
             $lists['extra_field_user'] = $field->list_all_field(7);
             // Field_section 6 : Company Address
             $lists['extra_field_company'] = $field->list_all_field(8);
             $lists['shipping_customer_field'] = $field->list_all_field(14, 0, 'billingRequired valid');
             $lists['shipping_company_field'] = $field->list_all_field(15, 0, 'billingRequired valid');
         }
     }
     if (($user->id || $auth['users_info_id'] > 0) && ONESTEP_CHECKOUT_ENABLE) {
         $this->setLayout('onestepcheckout');
     }
     $this->lists = $lists;
     parent::display($tpl);
 }