function display($tpl = null) { global $mainframe, $option; $this->params = JComponentHelper::getParams('com_quick2cart'); $user = JFactory::getUser(); $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $option = $jinput->get('option'); $view = $jinput->get('view'); $orderid = $jinput->get('orderid', ''); $emailMd5 = $jinput->get('guest_email', '', 'RAW'); $model = $this->getModel('downloads'); $layout = $jinput->get('layout', 'default'); $comquick2cartHelper = new comquick2cartHelper(); if ($layout == "default") { if ($emailMd5) { $this->guest_email_chk = $guest_email_chk = $comquick2cartHelper->checkmailhash($orderid, $emailMd5); //if order email and guest_email is same if (!$guest_email_chk) { $this->showMsg(JText::_('QTC_GUEST_MAIL_UNMATCH')); return false; } } if ($emailMd5) { $this->allDownloads = $model->getAllDownloads($user->id, $orderid); $this->pagination = $model->getPagination($user->id, $orderid); } else { $this->allDownloads = $model->getAllDownloads($user->id); $this->pagination = $model->getPagination($user->id); } $filter_order_Dir = $mainframe->getUserStateFromRequest($option . "{$view}.filter_order_Dir", 'filter_order_Dir', 'desc', 'word'); $filter_type = $mainframe->getUserStateFromRequest($option . "{$view}.filter_order", 'filter_order', 'oi.order_id', 'string'); $search = $mainframe->getUserStateFromRequest($option . 'search_list', 'search_list', '', 'string'); if ($search == null) { $search = ''; } // search filter $lists['search_list'] = $search; $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_type; // Get data from the model $this->lists = $lists; } $this->_setToolBar(); parent::display($tpl); }
</div> </div> </div> <?php return false; } if (isset($this->orders_site) && isset($this->undefined_orderid_msg)) { return false; } $params = JComponentHelper::getParams('com_quick2cart'); $user = JFactory::getUser(); $jinput = JFactory::getApplication()->input; $guest_email = $jinput->get('email', '', 'STRING'); if ($guest_email) { $guest_email_chk = 0; $guest_email_chk = $helperobj->checkmailhash($this->orderinfo[0]->id, $guest_email); if (!$guest_email_chk) { ?> <div class="well" > <div class="alert alert-error"> <span ><?php echo JText::_('QTC_GUEST_MAIL_UNMATCH'); ?> </span> </div> </div> </div> <?php return false; } } else {
/** * mediaFileAuthorise * * @param STRING $file_id file_id * @param STRING $strorecall strorecall * @param STRING $guest_email guest_email * @param STRING $order_item_id order_item_id * * @return html */ public function mediaFileAuthorise($file_id, $strorecall, $guest_email, $order_item_id) { // Get store id associatd with file id $db = JFactory::getDBO(); $query = "SELECT i.`store_id`,`file_id`,`file_display_name`,`filePath`,`purchase_required` FROM `#__kart_itemfiles` AS f\n\t\tLEFT JOIN `#__kart_items` AS i ON f.item_id=i.item_id\n\t\twhere f.`file_id`=" . $file_id; $db->setQuery($query); $fileDetail = $db->loadAssoc(); $comquick2cartHelper = new comquick2cartHelper(); $ret['validDownload'] = 0; $ret['orderItemFileId'] = 0; // FOR STORE AUTHORIZED PERSONS if (!empty($strorecall)) { $ret['validDownload'] = $comquick2cartHelper->store_authorize('product_default', $fileDetail['store_id']); return $ret; } elseif (empty($order_item_id) && $fileDetail['purchase_required'] == 0) { // Called from product detail page // For free media $ret['validDownload'] = 1; return $ret; } else { // Is authorized guest chekout if (!empty($guest_email)) { $orderid = $comquick2cartHelper->getOrderId($order_item_id); $guest_email_chk = $comquick2cartHelper->checkmailhash($orderid, $guest_email); if (empty($guest_email_chk)) { // Not matched $ret['validDownload'] = 0; return $ret; } } // Is expired date/download conunt or not $productHelper = new productHelper(); $ret = $productHelper->validDownload($file_id, $order_item_id); return $ret; } }