Example #1
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = JComponentHelper::getParams('com_quick2cart');
     $user = JFactory::getUser();
     $this->logged_userid = $user->id;
     // Check for errors.
     $errors = $this->get('Errors');
     if (count($errors)) {
         throw new Exception(implode("\n", $errors));
     }
     $jinput = JFactory::getApplication()->input;
     $layout = $jinput->get('layout', 'default', 'STRING');
     $option = $jinput->get('option', '', 'STRING');
     $storeOwner = $jinput->get('qtcStoreOwner', 0, 'INTEGER');
     $comquick2cartHelper = new comquick2cartHelper();
     //$client='com_quick2cart';
     //$client='*';
     //$products = $model->getProducts($client);
     //Get all stores.
     $this->store_details = $comquick2cartHelper->getAllStoreDetails();
     $this->categoryPage = 1;
     global $mainframe;
     $mainframe = JFactory::getApplication();
     $model = $this->getModel('category');
     //store_id is changed from  STORE view
     $change_storeto = $mainframe->getUserStateFromRequest('$option.current_store', 'current_store', '', 'INTEGER');
     $storeOwner = $jinput->get('qtcStoreOwner', 0, 'INTEGER');
     // FOR STORE OWNER
     if (!empty($storeOwner)) {
         $storehelper = new storehelper();
         $change_storeto = $storehelper->isVendorsStoreId($change_storeto);
     }
     $this->change_prod_cat = $mainframe->getUserStateFromRequest('prod_cat', 'prod_cat', '0', 'INTEGER');
     //vm: #25029
     $this->change_prod_cat = $jinput->get('prod_cat', 0, 'INTEGER');
     // retrun store_id,role etc with order by role,store_id
     $this->store_role_list = $store_role_list = $comquick2cartHelper->getStoreIds();
     $this->store_list = array();
     foreach ($this->store_role_list as $store) {
         $this->store_list[] = $store['store_id'];
     }
     //$this->products = $model->getAllProducts();
     $this->products = $this->items = $this->get('Items');
     //$mainframe->setUserState('$option.current_store', '0');  // VM:commentted  for store owner product view
     // when chage store,get latest storeid otherwise( on first load) set first storeid as default
     $this->store_id = $store_id = !empty($change_storeto) ? $change_storeto : '';
     //$store_role_list[0]['store_id'];
     $pagination = $model->getPagination();
     // ALL FETCH ALL CATEGORIES
     $this->cats = $comquick2cartHelper->getQ2cCatsJoomla($this->change_prod_cat);
     $this->pagination = $pagination;
     //Added by Sneha
     $filter_state = $mainframe->getUserStateFromRequest($option . 'search_list', 'search_list', '', 'string');
     $lists['search_list'] = $filter_state;
     $this->assignRef('lists', $lists);
     //End added by Sneha
     $this->_setToolBar();
     // Get toolbar path
     $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar');
     if ($layout == 'my') {
         if (!$this->logged_userid) {
             $msg = JText::_('QTC_LOGIN');
             $uri = JFactory::getApplication()->input->get('REQUEST_URI', '', 'server', 'string');
             $url = base64_encode($uri);
             $mainframe->redirect(JRoute::_('index.php?option=com_users&view=login&return=' . $url), $msg);
         }
         // Creating status filter.
         $statuses = array();
         $statuses[] = JHtml::_('select.option', '', JText::_('COM_QUICK2CART_SELONE'));
         $statuses[] = JHtml::_('select.option', 1, JText::_('COM_QUICK2CART_PUBLISH'));
         $statuses[] = JHtml::_('select.option', 0, JText::_('COM_QUICK2CART_UNPUBLISH'));
         $this->statuses = $statuses;
         // Setup toolbar
         $this->addTJtoolbar();
     }
     $this->_prepareDocument();
     parent::display($tpl);
 }
Example #2
0
			document.getElementById("store_creator_name").value = title;
		}

		SqueezeBox.close();
	}
</script>

<div class="<?php 
echo Q2C_WRAPPER_CLASS;
?>
 store-form">
	<form name="qtcCreateStoreForm" id="qtcCreateStoreForm" class="form-validate form-horizontal" method="post" enctype="multipart/form-data" onSubmit="return myValidate(this);" >
		<?php 
$active = 'create_store';
$comquick2cartHelper = new comquick2cartHelper();
$storehelper = new storehelper();
$user_stores = $storehelper->getuserStoreList();
if (count($user_stores) > 0) {
    if (!$mainframe->isAdmin()) {
        $view = $comquick2cartHelper->getViewpath('vendor', 'toolbar');
        ob_start();
        include $view;
        $html = ob_get_contents();
        ob_end_clean();
        echo $html;
    }
}
?>

		<legend>
			<?php