-
Notifications
You must be signed in to change notification settings - Fork 247
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
MSI-774: "Qty Uses Decimals" doesn't work for simple product #813
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution 👍
@@ -177,6 +177,9 @@ private function isQuantityIncrementCheckFailed( | |||
StockItemConfigurationInterface $stockItemConfiguration, | |||
float $requestedQty | |||
) : bool { | |||
if ($stockItemConfiguration->isQtyDecimal() && !$stockItemConfiguration->isEnableQtyIncrements()) { | |||
return false; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix looks incorrect to me.
- why did we add isDecimal check to existing Increment validation?
our desirable state to support decimal increment, so there should not be problem to have two independent checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maghamed , I've tested simple and configurable product with decimal qty on this branch with fixes from #1014 and #1015 and looks like everything works fine .
The only place I found, where decimal qty doesn't work is validator, mentioned above. And it's validation is pretty straightforward: if requested qty doesn't exactly divided by qty increments, it will fail(Currently it doesn't considering qty decimal stock item configuration, as core magento does), So, if I put qty decimal validation into separate check, the overall validation will still fail.
Can you please advise, how to implement qty decimal validation into separate validator without failing overall validation?
Fix for #774: "Qty Uses Decimals" doesn't work for simple product