Skip to content

Commit ccb0f7f

Browse files
Fix the special price expression.
Without this fix, catalog_product_price generate incorrect price data. The priority of "OR" is lower then "AND". That's why we have to add brackets around OR-expresstion.
1 parent c68a963 commit ccb0f7f

File tree

1 file changed

+1
-1
lines changed
  • app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ protected function getSelect($entityIds = null, $type = null)
456456
$specialFromExpr = "{$specialFrom} IS NULL OR {$specialFromDate} <= {$currentDate}";
457457
$specialToExpr = "{$specialTo} IS NULL OR {$specialToDate} >= {$currentDate}";
458458
$specialPriceExpr = $connection->getCheckSql(
459-
"{$specialPrice} IS NOT NULL AND {$specialFromExpr} AND {$specialToExpr}",
459+
"{$specialPrice} IS NOT NULL AND ({$specialFromExpr}) AND ({$specialToExpr})",
460460
$specialPrice,
461461
$maxUnsignedBigint
462462
);

0 commit comments

Comments
 (0)