/** * 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) { $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $app = JFactory::getApplication(); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_quick2cart'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } // Get user store list $storeHelper = new storeHelper(); // Get all stores. $user = JFactory::getUser(); $this->userStores = $storeHelper->getUserStore($user->id); // Get toolbar path $comquick2cartHelper = new comquick2cartHelper(); $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar'); // Publish states $this->publish_states = array('' => JText::_('JOPTION_SELECT_PUBLISHED'), '1' => JText::_('JPUBLISHED'), '0' => JText::_('JUNPUBLISHED')); // Setup TJ toolbar $this->addTJtoolbar(); $this->_prepareDocument(); parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { $this->params = JComponentHelper::getParams('com_quick2cart'); $comquick2cartHelper = new comquick2cartHelper(); $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $qtcshiphelper = new qtcshiphelper(); $app = JFactory::getApplication(); $jinput = $app->input; $user = JFactory::getUser(); $layout = $jinput->get('layout', 'default'); $model = $this->getModel('shipprofileform'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } if ($layout == 'default') { $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->form = $this->get('Form'); // Check whether user is authorized for this zone ? if (!empty($this->item->store_id)) { $status = $comquick2cartHelper->store_authorize('shipprofileform_default', $this->item->store_id); if (!$status) { $zoneHelper->showUnauthorizedMsg(); return false; } } // Get store name while edit view if (!empty($this->item->id) && !empty($this->item->store_id)) { $comquick2cartHelper = new comquick2cartHelper(); $this->storeDetails = $comquick2cartHelper->getSoreInfo($this->item->store_id); $this->shipPluglist = $model->getShipPluginListSelect(); } // Get shipping profile_id $shipprofile_id = $app->input->get('id', 0); // Getting saved tax rules. if (!empty($shipprofile_id)) { $this->shipMethods = $model->getShipMethods($shipprofile_id); } } else { $this->qtcShipProfileId = $jinput->get('id'); $this->shipmethId = $jinput->get('shipmethId', 0); $shipProfileDetail = $this->shipProfileDetail = $qtcshiphelper->getShipProfileDetail($this->qtcShipProfileId); // Getting saved tax rules. if (!empty($this->shipmethId) && !empty($shipProfileDetail['store_id'])) { // GET PLUGIN DETAIL $this->plgDetail = $qtcshiphelper->getPluginDetailByShipMethId($this->shipmethId); $this->shipPluglist = $model->getShipPluginListSelect($this->plgDetail['extension_id']); // Get plugin shipping methods $qtcshiphelper = new qtcshiphelper(); $this->response = $qtcshiphelper->qtcLoadShipPlgMethods($this->plgDetail['extension_id'], $shipProfileDetail['store_id'], $this->plgDetail['methodId']); } } $this->_prepareDocument(); parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { $comquick2cartHelper = new comquick2cartHelper(); $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $app = JFactory::getApplication(); $user = JFactory::getUser(); $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->params = $app->getParams('com_quick2cart'); $this->form = $this->get('Form'); if (!empty($this->item->zone_id)) { $zoneDetail = $zoneHelper->getZoneDetail($this->item->zone_id); // Check whether user is authorized for this zone ? if (!empty($zoneDetail['store_id'])) { $status = $comquick2cartHelper->store_authorize('taxrateform_default', $zoneDetail['store_id']); if (!$status) { $zoneHelper->showUnauthorizedMsg(); return false; } } } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
/** * 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) { $app = JFactory::getApplication(); $user = JFactory::getUser(); if (!$user->id) { ?> <div class="<?php echo Q2C_WRAPPER_CLASS; ?> my-coupons"> <div class="well" > <div class="alert alert-error"> <span><?php echo JText::_('QTC_LOGIN'); ?> </span> </div> </div> </div> <?php return false; } $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_quick2cart'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->publish_states = array('' => JText::_('JOPTION_SELECT_PUBLISHED'), '1' => JText::_('JPUBLISHED'), '0' => JText::_('JUNPUBLISHED')); // Get toolbar path $comquick2cartHelper = new comquick2cartHelper(); $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar'); // get store id (list))from model and pass to getManagecoupon() $this->store_role_list = $store_role_list = $comquick2cartHelper->getStoreIds(); if ($this->store_role_list) { $this->store_id = $store_id = !empty($change_storeto) ? $change_storeto : $store_role_list[0]['store_id']; $this->selected_store = $store_id; if ($this->store_id) { //$this->authorized_store_id= storeid of user $this->authorized_store_id = $authorized_store_id = $comquick2cartHelper->createCouponAuthority($store_id); } } // Setup TJ toolbar $this->addTJtoolbar(); $this->_prepareDocument(); parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { $zoneHelper = new zoneHelper(); $comquick2cartHelper = new comquick2cartHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible('zoneform', "default", 'form')) { return; } $app = JFactory::getApplication(); $previousId = JFactory::getApplication()->input->get('id'); $user = JFactory::getUser(); $jinput = $app->input; $layout = $jinput->get('layout', ''); $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->params = $app->getParams('com_quick2cart'); $this->form = $this->get('Form'); $model = $this->getModel('zoneform'); if ($this->item) { // Getting countries $country = $model->getCountry(); $this->country = $country; // Getting zone rules $this->geozonerules = $model->getZoneRules(); // Check whether user is authorized for this zone ? if (!empty($this->item->store_id)) { $status = $comquick2cartHelper->store_authorize('zoneform_default'); if (!$status) { $zoneHelper->showUnauthorizedMsg(); return false; } } } // For edit zone rules if ($layout === 'setrule') { $this->rule_id = $jinput->get('zonerule_id'); // Getting zone rule detail $this->ruleDetail = $model->getZoneRuleDetail($this->rule_id); if (!empty($this->ruleDetail->country_id)) { // Getting Regions from country $this->getRegionList = $model->getRegionList($this->ruleDetail->country_id); } // Getting countries $country = $model->getCountry(); $this->country = $country; $app->setUserState('com_quick2cart.edit.zone.id', $previousId); } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
function display($tpl = null) { $comquick2cartHelper = new comquick2cartHelper(); $app = JFactory::getApplication(); $this->params = $app->getParams('com_quick2cart'); $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $option = 'com_quick2cart'; $nameSpace = 'com_quick2cart.shipping'; $task = $jinput->get('task'); $view = $jinput->get('view', ''); $layout = $jinput->get('layout', 'default'); // Get other vars $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar'); if ($layout == 'default') { // Display list of pluigns $filter_order = $mainframe->getUserStateFromRequest($nameSpace . 'filter_order', 'filter_order', 'tbl.id', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($nameSpace . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_orderstate = $mainframe->getUserStateFromRequest($nameSpace . 'filter_orderstate', 'filter_orderstate', '', 'string'); $filter_name = $mainframe->getUserStateFromRequest($nameSpace . 'filter_name', 'filter_name', 'tbl.name', 'cmd'); $search = $mainframe->getUserStateFromRequest($nameSpace . 'search', 'search', '', 'string'); if (strpos($search, '"') !== false) { $search = str_replace(array('=', '<'), '', $search); } $search = JString::strtolower($search); $model = $this->getModel('shipping'); // Get data from the model $items = $this->get('Items'); $total = $model->getTotal(); $pagination = $model->getPagination(); if (count($items) == 1) { // If there is only one plug then redirct to that shipping view $extension_id = $items[0]->extension_id; $this->form = ''; if ($extension_id) { $this->form = $this->getShipPluginForm($extension_id); $plugConfigLink = "index.php?option=com_quick2cart&task=shipping.getShipView&extension_id=" . $extension_id; $CpItemid = $comquick2cartHelper->getItemId('index.php?option=com_quick2cart&view=vendor&layout=cp'); $redirect = JRoute::_($plugConfigLink . '&Itemid=' . $itemid, false); $app->redirect($redirect); } } // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $lists['filter_name'] = $filter_name; // search filter $lists['search'] = $search; $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); } elseif ($layout == 'list') { $this->form = ''; $extension_id = $jinput->get('extension_id'); if ($extension_id) { $this->form = $this->getShipPluginForm($extension_id); } } //JToolBarHelper::title(JText::_('COM_QUICK2CART_SHIPM_SHIPPING_METHODS','quick2cart-logo'); //JToolBarHelper::title(JText::_('COM_QUICK2CART_SHIPM_SHIPPING_METHODS')); parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { $comquick2cartHelper = new comquick2cartHelper(); $zoneHelper = new zoneHelper(); // Check whether view is accessible to user if (!$zoneHelper->isUserAccessible()) { return; } $app = JFactory::getApplication(); $jinput = $app->input; $user = JFactory::getUser(); $this->params = $app->getParams('com_quick2cart'); $layout = $jinput->get('layout', 'default'); $model = $this->getModel('taxprofileform'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } if ($layout == 'default') { $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->form = $this->get('Form'); // Get taxprofile_id $taxprofile_id = $app->input->get('id', 0); // Getting saved tax rules. if (!empty($taxprofile_id)) { $this->taxrules = $model->getTaxRules($taxprofile_id); } // Check whether user is authorized for this zone ? if (!empty($this->item->store_id)) { $status = $comquick2cartHelper->store_authorize('taxprofileform_default', $this->item->store_id); if (!$status) { $zoneHelper->showUnauthorizedMsg(); return false; } } // Get store name while edit view if (!empty($this->item->id) && !empty($this->item->store_id)) { $comquick2cartHelper = new comquick2cartHelper(); $this->storeDetails = $comquick2cartHelper->getSoreInfo($this->item->store_id); // Getting tax rates and Adress types $this->taxrate = $model->getTaxRateListSelect($this->item->store_id, ''); $this->address = $model->getAddressList(); } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } } else { $this->taxRule_id = $jinput->get('id'); $defaultTaxRateId = ''; $defaultAddressId = ''; // Getting saved tax rules. if (!empty($this->taxRule_id)) { $this->taxrules = $model->getTaxRules('', $this->taxRule_id); if (!empty($this->taxrules)) { $defaultTaxRateId = $this->taxrules[0]->taxrate_id; $defaultAddressId = $this->taxrules[0]->address; } // Get store id of taxrule $taxHelper = new taxHelper(); $store_id = $taxHelper->getStoreIdFromTaxrule($this->taxRule_id); if (empty($store_id)) { $this->qtcStoreNotFoundMsg(); } // Getting tax rates and Adress types $this->taxrate = $model->getTaxRateListSelect($store_id, $defaultTaxRateId); $this->address = $model->getAddressList($defaultAddressId); } } $this->_prepareDocument(); parent::display($tpl); }