function isPTypeExistInSession() { $aecExists = XiptLibAec::isAecExists(); $payplansExists = XiptLibPayplans::isPayplansExists(); $subs_integrate = XiptFactory::getSettings('subscription_integrate', 0); $integrate_with = XiptFactory::getSettings('integrate_with', 0); //if JSPT is integrated with AEC if ($aecExists && $subs_integrate && $integrate_with == 'aec') { $data = XiptLibAec::getProfiletypeInfoFromAEC(); return $data['profiletype']; } //if JSPT is integrated with Payplans if ($payplansExists && $subs_integrate && $integrate_with == 'payplans') { $data = XiptLibPayplans::getProfiletypeInfoFromPayplans(); return $data['profiletype']; } if ($this->mySess->has('SELECTED_PROFILETYPE_ID', 'XIPT') == false) { return 0; } return $this->mySess->get('SELECTED_PROFILETYPE_ID', 0, 'XIPT'); }
function event_com_xipt_registration_blank() { $app = JFactory::getApplication(); $subs_integrate = XiptFactory::getSettings('subscription_integrate', 0); $integrate_with = XiptFactory::getSettings('integrate_with', 0); if (!$subs_integrate) { return false; } //when integrated with AEC, set PT in session as per plan. if ($integrate_with == 'aec') { if (!XiptLibAec::isAecExists()) { return false; } // find selected profiletype from AEC $aecData = XiptLibAec::getProfiletypeInfoFromAEC(); // as user want to integrate the AEC so a plan must be selected // send user to profiletype selection page if ($aecData['planSelected'] == false) { $app->redirect(XiptRoute::_('index.php?option=com_acctexp&task=subscribe', false), XiptText::_('PLEASE_SELECT_AEC_PLAN_IT_IS_RQUIRED')); } // set selected profiletype in session $this->_pluginHandler->mySess->set('SELECTED_PROFILETYPE_ID', $aecData['profiletype'], 'XIPT'); } //when integrated with Payplans, no need to set PT in session //payplans itself set PT in session if ($integrate_with == 'payplans') { if (!XiptLibPayplans::isPayplansExists()) { return false; } // find selected profiletype from Payplans $payplansData = XiptLibPayplans::getProfiletypeInfoFromPayplans(); // as user want to integrate the Payplans so a plan must be selected // send user to profiletype selection page if ($payplansData['planSelected'] == false) { $app->redirect(XiptRoute::_('index.php?option=com_payplans&view=plan', false), XiptText::_('PLEASE_SELECT_AEC_PLAN_IT_IS_RQUIRED')); } } $app->redirect(XiptHelperJomsocial::getReturnURL()); return true; }