Merge remote-tracking branch 'origin/ticket-14666-appli-discount' into develop
This commit is contained in:
commit
8d24b036e5
@ -839,6 +839,13 @@ class Cart extends CartCore {
|
||||
|
||||
if (!$order_total)
|
||||
return Tools::displayError('Cannot add voucher if order is free.');
|
||||
|
||||
// Ony for API (application)
|
||||
$subdomain = substr($_SERVER['HTTP_HOST'], 0, strpos($_SERVER['HTTP_HOST'], '.'));
|
||||
if ($subdomain != 'api' && $discountObj->appli == 1) {
|
||||
return Tools::displayError('This voucher is not valid');
|
||||
}
|
||||
|
||||
if (!$discountObj->active)
|
||||
return Tools::displayError('This voucher has already been used or is disabled.');
|
||||
if (!$discountObj->quantity)
|
||||
|
Loading…
Reference in New Issue
Block a user