Skip to content

Commit 5a6eb3a

Browse files
committed
MAGETWO-69714: Cannot delete product tier-prices
1 parent cce17a6 commit 5a6eb3a

File tree

1 file changed

+2
-20
lines changed
  • app/code/Magento/Catalog/Model/Product/Attribute/Backend

1 file changed

+2
-20
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,8 @@ protected function updateValues(array $valuesToUpdate, array $oldValues)
180180
{
181181
$isChanged = false;
182182
foreach ($valuesToUpdate as $key => $value) {
183-
$oldPrice = $this->prepareFloatValue($oldValues[$key]['price']);
184-
$newPrice = $this->prepareFloatValue($value['value']);
185-
$oldQty = $this->prepareFloatValue($oldValues[$key]['price_qty']);
186-
$newQty = $this->prepareFloatValue($value['qty']);
187-
$oldPercentageValue = $this->prepareFloatValue($this->getPercentage($oldValues[$key]));
188-
$newPercentageValue = $this->prepareFloatValue($this->getPercentage($value));
189-
if (($oldPrice !== $newPrice)
190-
|| ($oldQty !== $newQty)
191-
|| ($oldPercentageValue !== $newPercentageValue)
183+
if ($oldValues[$key]['price'] != $value['value']
184+
|| $this->getPercentage($oldValues[$key]) != $this->getPercentage($value)
192185
) {
193186
$price = new \Magento\Framework\DataObject(
194187
[
@@ -205,17 +198,6 @@ protected function updateValues(array $valuesToUpdate, array $oldValues)
205198
return $isChanged;
206199
}
207200

208-
/**
209-
* Prepare float value for comparison
210-
*
211-
* @param string|float|int $value
212-
* @return float
213-
*/
214-
private function prepareFloatValue($value)
215-
{
216-
return floatval(str_replace(',', '.', (string)$value));
217-
}
218-
219201
/**
220202
* Check whether price has percentage value.
221203
*

0 commit comments

Comments
 (0)