Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

nmalevanec
Copy link
Contributor

@nmalevanec nmalevanec commented Mar 30, 2018

Fix for #774: "Qty Uses Decimals" doesn't work for simple product

@nmalevanec nmalevanec modified the milestone: MSI Part I Mar 30, 2018
@larsroettig larsroettig self-requested a review April 1, 2018 10:08
larsroettig
larsroettig previously approved these changes Apr 1, 2018
Copy link
Member

@larsroettig larsroettig left a 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 👍

@larsroettig larsroettig self-assigned this Apr 1, 2018
@larsroettig larsroettig added this to the MSI Part I milestone Apr 1, 2018
@@ -177,6 +177,9 @@ private function isQuantityIncrementCheckFailed(
StockItemConfigurationInterface $stockItemConfiguration,
float $requestedQty
) : bool {
if ($stockItemConfiguration->isQtyDecimal() && !$stockItemConfiguration->isEnableQtyIncrements()) {
return false;
}
Copy link
Contributor

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

Copy link
Contributor Author

@nmalevanec nmalevanec Apr 24, 2018

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?

@maghamed maghamed dismissed larsroettig’s stale review April 21, 2018 15:11

incorrect review

@maghamed maghamed assigned nmalevanec and unassigned larsroettig Apr 21, 2018
@nmalevanec nmalevanec closed this Apr 30, 2018
@maghamed maghamed deleted the MSI-774 branch March 20, 2019 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants