diff --git a/modules/blockuserinfo/blockuserinfo.php b/modules/blockuserinfo/blockuserinfo.php
index fa7e204a..7d6171fc 100755
--- a/modules/blockuserinfo/blockuserinfo.php
+++ b/modules/blockuserinfo/blockuserinfo.php
@@ -74,6 +74,7 @@ class BlockUserInfo extends Module
}
$display_credits = false;
+ $loyalties = null;
if ($this->disableCredits === false) {
$display_credits = true;
$sql = 'SELECT id_customer FROM `'._DB_PREFIX_.'customer_credits` WHERE id_customer = ' .(int) $cookie->id_customer;
@@ -115,6 +116,7 @@ class BlockUserInfo extends Module
global $smarty, $cookie, $cart;
$display_credits = false;
+ $loyalties = null;
if ($this->disableCredits === false) {
$display_credits = true;
if ($cookie->logged) {
diff --git a/modules/invite/invite-program.php b/modules/invite/invite-program.php
index 3b71f94f..08a04888 100644
--- a/modules/invite/invite-program.php
+++ b/modules/invite/invite-program.php
@@ -13,7 +13,7 @@ include(dirname(__FILE__).'/../../header.php');
$invite = new Invite();
-$activeTab = 'sponsor';
+$activeTab = 'credit';
$error = FALSE;
$revive_sent = FALSE;
$mails_exists = array();
@@ -241,6 +241,8 @@ if($oi_enable = Configuration::get('INVITE_OPENINVITER_ENABLE')) {
$oi_services = $inviter->getPlugins();
}
+$customer_credit = $invite->_get_credit((int) $cookie->id_customer, false, false, 'frontoffice');
+
$smarty->assign(array(
'activeTab' => $activeTab,
'orderQuantity' => $orderQuantity,
@@ -265,8 +267,8 @@ $smarty->assign(array(
'oi_enable' => $oi_enable,
'pendingFriends' => $invite->getPendingFriends($customer->id),
'subscribeFriends' => $invite->getFriends($customer->id),
- 'currency' => $currency->sign,
-
+ 'currency' => $currency->sign,
+ 'customer_credit' => $customer_credit,
));
echo Module::display(dirname(__FILE__).'/invite.php', 'invite-program.tpl');
diff --git a/modules/invite/invite.php b/modules/invite/invite.php
index 0b96d796..94f88379 100644
--- a/modules/invite/invite.php
+++ b/modules/invite/invite.php
@@ -1427,7 +1427,8 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
return $result.'
';
}
- private function _get_credit($id_customer=FALSE, $value=FALSE, $with_sign=FALSE, $mode=FALSE) {
+ public function _get_credit($id_customer=FALSE, $value=FALSE, $with_sign=FALSE, $mode=FALSE)
+ {
$credit = Db::getInstance()->ExecuteS('
SELECT *
FROM `'._DB_PREFIX_.'invite_credit`
@@ -1946,7 +1947,8 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
');
}
- public function getFriends($id_customer=FALSE, $nb_limit) {
+ public function getFriends($id_customer = false, $nb_limit = false)
+ {
if(!(int) $id_customer) {
return array();
}
diff --git a/modules/invite/shopping-cart-credit.tpl b/modules/invite/shopping-cart-credit.tpl
index d0eb2cc3..9ee7f9ae 100755
--- a/modules/invite/shopping-cart-credit.tpl
+++ b/modules/invite/shopping-cart-credit.tpl
@@ -1,6 +1,9 @@
{l s='Referral program:' mod='invite'}
*}- {l s='Click here to use your credit' mod='invite'}
{$invite_credit[0]|string_format:'%.02f'} {$invite_credit[2]} {l s='will be deducted from your order total.' mod='invite'}
+ + {l s='Click here to use your credit' mod='invite'} +{$invite_credit[0]|string_format:'%.02f'} {$invite_credit[2]} + {l s='will be deducted from your order total.' mod='invite'}