-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix the special price expression. #16510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the special price expression. #16510
Conversation
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.
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.
Hi @DmitryChukhnov. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi, @DmitryChukhnov, thank you for collaboration. Can you please provide more information or use case that related to this issue. I understand that current condition is wrong, but maybe the second condition is redundant |
Hi, @VladimirZaets . In my case I have not null specialFrom and null specialPrice (you can get this conditions if you save special price and then remove special price). {$specialPrice} IS NOT NULL AND {$specialFromExpr} AND {$specialToExpr} => (substitution) {$specialPrice} IS NOT NULL AND {$specialFrom} IS NULL OR {$specialFromDate} <= {$currentDate} AND {$specialTo} IS NULL OR {$specialToDate} >= {$currentDate} => (with values) null IS NOT NULL AND "2018-07-01" IS NULL OR "2018-07-01" <= "2018-07-04" AND null IS NULL OR null >= "2018-07-04" => (comparison) FALSE AND FALSE OR TRUE AND TRUE OR FALSE => (AND) FALSE OR TRUE OR FALSE => (OR) TRUE But should be FALSE. I hope this helps. |
@DmitryChukhnov thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Hi @DmitryChukhnov. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
Description
The priority of "OR" is lower then "AND". That's why we have to add brackets around OR-expresstion.
Fixed Issues (if relevant)
Without this fix, catalog_product_price generate incorrect price data.