Cupara
Well-known member
I'm trying to extend 3rd party mods so that my xfPoints mod can tie into them. The problem I'm having is extending to the point that my variables are accessible within the templates.
Take for instance a Ice Shop, trying to tie into the public view where I can give a total of points accumulated before they purchase items. Once they purchase an item the points are deducted instead of using real currency. Don't know how Ice Shop works but using it as an example.
I have this so far:
So if anyone can give me some guidance here it would be much appreciated.
Take for instance a Ice Shop, trying to tie into the public view where I can give a total of points accumulated before they purchase items. Once they purchase an item the points are deducted instead of using real currency. Don't know how Ice Shop works but using it as an example.
I have this so far:
Code:
class xfPoints_ControllerPublic_Shop extends XFCP_xfPoints_ControllerPublic_Shop
{
public function actionIndex()
{
$response = parent::actionIndex();
$user_id = XenForo_Visitor::getUserId();
$pointsModel = $this->getModelFromCache('xfPoints_Model_Currency');
$totalPoints = $pointsModel->getUserPointsId($user_id);
$totalPoints = $totalPoints['xfpoints_currency'];
$response = array(
'totalPoints' => $totalPoints,
);
return $response;
}
}
So if anyone can give me some guidance here it would be much appreciated.