/** * This function load data which is require for creatshipmeth layout (INTERNAL USE ONLY). * * @param object $jinput Joomla's jinput Object. * * @since 2.2 * @return Layoutdata. */ function loadViewDataForCreateshipmeth($jinput) { $shipForm = array(); $shipForm['methodId'] = $shipMethId = $jinput->get('methodId', 0); //$shipForm['methodName'] = ; $qtczoneShipHelper = new qtczoneShipHelper(); $taxHelper = new taxHelper(); if (!empty($shipMethId)) { $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select(" id AS methodId,name,store_id,taxprofileId,state,shipping_type,min_value,max_value")->from('#__kart_zoneShipMethods')->where('id=' . $shipMethId); $db->setQuery((string) $query); $shipForm = $db->loadAssoc(); // If ship type= price per store item if ($shipForm['shipping_type'] == 3) { $query = $db->getQuery(true); $query->select(" mc.*")->from('#__kart_zoneShipMethodCurr AS mc')->where('mc.methodId=' . $shipMethId); $db->setQuery((string) $query); $shipMethCurr = $db->loadAssocList(); $shipForm['shipMethCurr'] = $shipMethCurr; } // Get tax profiles $shipForm['taxprofiles'] = $taxHelper->getUsersTaxprofiles(); } else { $shipForm['store_id'] = ''; $shipForm['methodType'] = 0; $shipForm['taxprofileId'] = 0; $shipForm['state'] = 1; $shipForm['shipping_type'] = 0; // Get tax profiles $shipForm['taxprofiles'] = $taxHelper->getUsersTaxprofiles(); } return $shipForm; }