ABPro + Alpha User Points
This How-to is based on material contributed by an ABPro user who wished to share his sucesses in using ABPro and Alpha User Points with others
Thanks Dominick!
Disclaimer: I have no knowledge of Alpha User Points, have never installed it and never used it so I can offer no additional information.
The download: AUP_ABPro.zip
The zip contains two ABPro code files.
Rather than replacing the ones you are using, and risking version compatibility problems, here is how to change your files.
File Changes
Edit your GAD booking screen view file's controller:
\components\com_rsappt_pro2\controllers\booking_screen_gad.php
Around line 345 look for:
if(($paypal_submit == "1" || $paypal_submit == "2" || $paypal_submit == "3") && floatval($grand_total) > 0){
/* -----------------------------------------------------------------------------------
/* go to Payment Processor
/* -------------------------------------------------------------------------------------*/
Insert the red code in front..
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
AlphaUserPointsHelper::newpoints( 'plgaup_apptbook' );
}
if(($paypal_submit == "1" || $paypal_submit == "2" || $paypal_submit == "3") && floatval($grand_total) > 0){
/* -----------------------------------------------------------------------------------
/* go to Payment Processor
/* -------------------------------------------------------------------------------------*/
Edit the front-end cancel file:
\components\com_rsappt_pro2\ajax\fe_cancel.php
Around line 161 look for:
$sql = "SELECT #__sv_apptpro2_resources.resource_admins, #__sv_apptpro2_resources.resource_email, #__sv_apptpro2_requests.* ".
Insert this the red code in front..
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
AlphaUserPointsHelper::newpoints( 'plgaup_apptcxl', '', '', '', -5);
}
$sql = "SELECT #__sv_apptpro2_resources.resource_admins, #__sv_apptpro2_resources.resource_email, #__sv_apptpro2_requests.* ".
Please refer to the Readme.txt file in the download for the installation and operation instructions.