Skip to content

Commit b23ddd7

Browse files
author
Sergey Shvets
committed
MAGETWO-82132: Comma special character in cart price rule condition value results in incorrect rule
1 parent 0383b22 commit b23ddd7

File tree

1 file changed

+8
-0
lines changed
  • app/code/Magento/SalesRule/Model/Rule/Condition

1 file changed

+8
-0
lines changed

app/code/Magento/SalesRule/Model/Rule/Condition/Product.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\SalesRule\Model\Rule\Condition;
78

89
/**
@@ -55,6 +56,13 @@ public function validate(\Magento\Framework\Model\AbstractModel $model)
5556
return $this->validateAttribute($this->_getAvailableInCategories($product->getId()));
5657
}
5758

59+
if ($attrCode === 'quote_item_price') {
60+
$numericOperations = $this->getDefaultOperatorInputByType()['numeric'];
61+
if (in_array($this->getOperator(), $numericOperations)) {
62+
$this->setData('value', $this->_localeFormat->getNumber($this->getValue()));
63+
}
64+
}
65+
5866
return parent::validate($product);
5967
}
6068

0 commit comments

Comments
 (0)