function save() { $app = JFactory::getApplication(); $user = JFactory::getUser(); if ($user->id) { //pullhikashop stuff if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php'; $checkout = JRoute::_('index.php?option=com_hikashop&view=checkout&layout=step&Itemid=635'); $class = hikashop::get('class.cart'); $product_id = isset($_POST['pid']) ? $_POST['pid'] : ''; $quantity = isset($_POST['pquantity']) ? $_POST['pquantity'] : ''; $class->update($product_id, $quantity); //save bulk order here } }
define('_VALID_MOS', 1); define('JPATH_BASE', realpath(dirname(__FILE__))); define('DS', DIRECTORY_SEPARATOR); require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php'; require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php'; $mainframe = JFactory::getApplication('site'); $mainframe->initialise(); $app = JFactory::getApplication(); $input = JFactory::getApplication()->input; $data_base = JFactory::getDBO(); //add joomla framework support if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) { return 'This module can not work without the Hikashop Component'; } //hikashop helper loading $hikashop = new hikashop(); //get this order's id $qu = 'select * from #__hikashop_order where mpesa_code = ' . $input->get('mpesa_code') . ''; $db->setQuery($qu); $result = $db->loadObject(); $orderid = $result->order_id; $fullprice = $result->order_full_price; $order_details = $hikashop->getOrder($orderid); require_once 'configuration.php'; $config = new JConfig(); $host = $config->host; $user = $config->user; $prefix = $config->dbprefix; $pass = $config->password; $db = $config->db; $mailfrom = $config->mailfrom;