Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop
This commit is contained in:
commit
b5ecd7fb2a
@ -1274,8 +1274,9 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
|
||||
if (Tools::getIsset('submitAddSponsor')) {
|
||||
$id_sponsor = Tools::getValue('id_sponsor');
|
||||
if (empty($id_sponsor)) {
|
||||
// Do nothing
|
||||
// Do nothing - it's the same
|
||||
} else {
|
||||
// Following the number of orders
|
||||
if (count($orders) < 2) {
|
||||
$sponsor = Db::getInstance()->getRow('SELECT id_sponsor FROM `'._DB_PREFIX_.'invite`
|
||||
WHERE `id_customer`='.$customer->id);
|
||||
@ -1302,17 +1303,18 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
|
||||
NOW(),
|
||||
0
|
||||
)');
|
||||
|
||||
// Create rewards
|
||||
if (count($orders) == 1 && $result) {
|
||||
$sponsorCustomer = new Customer($id_sponsor);
|
||||
$this->_make_rewards($sponsorCustomer->id);
|
||||
}
|
||||
}
|
||||
// Replace - Do nothing
|
||||
/*else {
|
||||
// Replace
|
||||
else {
|
||||
$result = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'invite` SET `id_sponsor`='.$id_sponsor.
|
||||
' WHERE `id_customer`='.$customer->id);
|
||||
}*/
|
||||
|
||||
if (count($orders) == 1 && $result) {
|
||||
$sponsorCustomer = new Customer($id_sponsor);
|
||||
$this->_make_rewards($sponsorCustomer->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user