public function preProcess() { parent::preProcess(); $db = Db::getInstance(_PS_USE_SQL_SLAVE_); $res = $db->ExecuteS("SELECT \n\t\t\t\t\t\t\tdescription, \n\t\t\t\t\t\t\treference, \n\t\t\t\t\t\t\tdate_add, \n\t\t\t\t\t\t\tpoints_awarded, \n\t\t\t\t\t\t\tcoalesce(points_deducted, '-') as `points_deducted`, \n\t\t\t\t\t\t\tbalance FROM vb_customer_rewards WHERE id_customer = " . self::$cookie->id_customer . "\n\t\t\t\t\t\t\torder by id_reward desc"); self::$smarty->assign('vbpoints', $res); self::$smarty->assign('balance_points', VBRewards::getCustomerPoints(self::$cookie->id_customer)); self::$smarty->assign('redeemed_points', VBRewards::getCustomerPointsRedeemed(self::$cookie->id_customer)); self::$smarty->assign('earned_points', VBRewards::getCustomerPointsEarned(self::$cookie->id_customer)); self::$smarty->assign('reviews_approved', Customer::getTotalApprovedReviews(self::$cookie->id_customer)); self::$smarty->assign('social_points', $this->getSocialPoints()); $referrals = Customer::getCustomerReferrals(self::$cookie->id_customer); if ($referrals) { self::$smarty->assign('total_referred', count($referrals)); } }