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

Unable add product to cart in Magento 2.3.3 backend when stock quantity is 1 - "The requested qty is not available" #25675

Closed
wibbel opened this issue Nov 20, 2019 · 14 comments
Assignees
Labels
Component: Admin Component: Sales Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@wibbel
Copy link

wibbel commented Nov 20, 2019

The problem is only shown in the 2.3.3 backend when making orders from Magento Admin. Any product that is added to te order that only has available stock of 1 displays "The requested qty is not available". Quantities of greater than 1 are fine.

Preconditions (*)

  1. Magento 2.3.3
  2. Standard luma system
  3. From Admin backend, modify one of the products so that quantity in stock is 1 e.g. Joust Duffle Bag

2019-11-20_18-51-16

Steps to reproduce (*)

  1. Create a new customer order from backend, e.g select existing customer , [email protected]
  2. Add the product to the cart that was changed to have stock of 1 e.g. Joust Duffle Bag

Expected result (*)

  1. product is added to cart without errors

Actual result (*)

  1. Error message is displayed "The requested qty is not available"

2019-11-20_18-50-35

@m2-assistant
Copy link

m2-assistant bot commented Nov 20, 2019

Hi @wibbel. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@wibbel do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Nov 20, 2019
@wibbel
Copy link
Author

wibbel commented Nov 20, 2019

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @wibbel. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @wibbel, here is your Magento instance.
Admin access: https://i-25675-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@wibbel
Copy link
Author

wibbel commented Nov 20, 2019

Confirmed on test instance
2019-11-20_18-59-26

2019-11-20_18-59-06

@ajijshekh123 ajijshekh123 self-assigned this Nov 21, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 21, 2019

Hi @ajijshekh123. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@ajijshekh123
Copy link

Give me @magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @ajijshekh123. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @ajijshekh123, here is your Magento instance.
Admin access: https://i-25675-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@ajijshekh123
Copy link

I have verified this issue. I have reproduced this issue.
Please see attached the video:

Qty_Issue

@wibbel - When the user clicks on the "Update Items and Quantities' button, This error will be gone.

@ajijshekh123 ajijshekh123 added Component: Admin Component: Sales Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 21, 2019
@ghost ghost unassigned ajijshekh123 Nov 21, 2019
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Nov 21, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @ajijshekh123
Thank you for verifying the issue. Based on the provided information internal tickets MC-29034 were created

Issue Available: @ajijshekh123, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@molneek molneek self-assigned this Nov 23, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 23, 2019

Hi @molneek. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


molneek added a commit to molneek/magento2 that referenced this issue Nov 23, 2019
molneek added a commit to molneek/magento2 that referenced this issue Nov 25, 2019
molneek added a commit to molneek/magento2 that referenced this issue Nov 25, 2019
@ghost ghost unassigned molneek Jan 10, 2020
@not-art
Copy link

not-art commented Jan 27, 2020

I'm unsure if this is related, but we're experiencing something similar:

If we have a configurable product with a simple child item that's at its last qty available of stock, we can add it to the cart, but if we update the cart programatically behind the scenes (post to our 3rd party payment provider and save a custom value on the quote, for example), Magento throws a,

"Could not save custom_field_1 to quote: \nThe requested qty is not available"

This only happens for child items on configurables. This does NOT happen for simple items ordered by themselves.

I will file this as a separate bug, but it definitely feels related to this code execution path.

To reproduce:

  1. Magento 2.3.3, with all 2.3.3 supplemental patches
  2. MSI modules disabled
  3. OOS Threshold set to 0 (so items go OOS after ordering 1 last qty), we also tested with OOS Threshold set to 3 (so items go OOS after ordering the 4th qty left)
  4. Have a custom field on the quote table, lets call it "custom_field_1", make it a varchar(255)
  5. Have an observer or plugin in your checkout progress (before converting your quote to an order / completing order), which updates quote.custom_field_1 to "test", preferably before payment step / after shipping step
  6. Add a configurable item to your cart, selecting a child option whose stock is at 1, so this will be the last sellable unit
  7. Proceed into checkout, proceed past shipping (to have your observer update the quote)
  8. Rather than proceeding to your payment step of checkout, you'll return to cart, with a message of an unknown error occurring, and a log should be written saying "Could not save custom_field_1 to quote: \nThe requested qty is not available", if you have a try/catch around your quote.setCustomField1("test") in your observer.

molneek added a commit to molneek/magento2 that referenced this issue Feb 1, 2020
@ghost ghost assigned molneek Feb 1, 2020
molneek added a commit to molneek/magento2 that referenced this issue Feb 2, 2020
@ghost ghost assigned molneek and unassigned molneek Feb 2, 2020
@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Feb 21, 2020
@magento-engcom-team
Copy link
Contributor

Hi @wibbel. Thank you for your report.
The issue has been fixed in #26650 by @molneek in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Admin Component: Sales Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants