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
Fixed #18812 #22849
Fixed #18812 #22849
Conversation
Hi @shikhamis11. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
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.
Hi @shikhamis11,
could you please check and fix the automated tests failures?
@shikhamis11, please note, the static need to be also fixed. |
…cart when quantity is 1
b6f1f33
to
a86f251
Compare
Hi @dmytro-ch please review. |
Hi @dmytro-ch, thank you for the review. |
✔️ QA Passed |
@shikhamis11 unfortunately, only members of the maintainers team are allowed to unassign developers from the pull request |
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.
Hi @shikhamis11 thanks for the pull request, I have several questions regarding this pull request, can you please take a look at my review comments
/** | ||
* we are using 0 because original qty was processed | ||
*/ | ||
$qtyForCheck = $this->quoteItemQtyList |
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.
Hi @shikhamis11 @dmytro-ch can you please provide an explanation on how this change is fixing the issue. Also, can you please explain the comment "we are using 0 because original qty was processed" - where the qty was processed?
As far as I remember \Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\QuoteItemQtyList::getQty
was working incorrectly becouse of null
is passed as $quoteItemId
in certain cases
@shikhamis11 , I am closing this PR now due to inactivity. |
Hi @shikhamis11, thank you for your contribution! |
Fixed #18812 Unable to update simple product custom option in cart when quantity is 1
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Notes
It manifests as well if you have configurable product, where associated product has 1 stock, and configurable has custom option. Once selected and added to cart. If you try to update only custom option, the result is the same.
It appears that the code in
Magento/Quote/Model/Quote.php#updateItem
updates product item or adds new one if product item with matching custom/configurable options does not exist and later removes old item.Problem is inside
updateItem()
, call to to addProduct() throws, because actual product qty is 1.