Skip to content

Commit

Permalink
Merge pull request #8274 from hibatallahAouadni/PSCSX-7932
Browse files Browse the repository at this point in the history
Disallow the negative discounts in orders
  • Loading branch information
Pablo Borowicz committed Sep 24, 2018
2 parents ae5b7e0 + b3bd244 commit 4db399e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/admin/AdminOrdersController.php
Expand Up @@ -1334,6 +1334,8 @@ public function postProcess()
if ($this->tabAccess['edit'] === '1') {
if (!Tools::getValue('discount_name')) {
$this->errors[] = Tools::displayError('You must specify a name in order to create a new discount.');
} elseif ((float)Tools::getValue('discount_value') <= 0) {
$this->errors[] = Tools::displayError('The discount value is invalid.');
} else {
if ($order->hasInvoice()) {
// If the discount is for only one invoice
Expand Down

0 comments on commit 4db399e

Please sign in to comment.