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

2 error messages in Cart when product is out of stock #27469

Closed
stkrelax opened this issue Mar 27, 2020 · 20 comments
Closed

2 error messages in Cart when product is out of stock #27469

stkrelax opened this issue Mar 27, 2020 · 20 comments
Assignees
Labels
Area: Frontend Component: CatalogInventory 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 Reported on 2.3.3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@stkrelax
Copy link

Preconditions (*)

Magento 2.3.3, CatalogInventory Modules and MSI Modules enabled

  1. You need a product
  2. you must be able to change qty of that product

Steps to reproduce (*)

  1. put product in Cart
  2. change qty to 0 and outofstock
  3. press f5 in cart

Expected result (*)

  1. one message stating that the product is out of stock appears in the list of the cartitems

Actual result (*)

  1. two message stating that the product is out of stock appear
    This product is out of stock. --> from CatalogInventory
    There are no source items with the in stock status --> from Magento_InventorySales

grafik

@m2-assistant
Copy link

m2-assistant bot commented Mar 27, 2020

Hi @stkrelax. 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.4-develop instance - upcoming 2.4.x release

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

@stkrelax 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 Mar 27, 2020
@ghost ghost added this to Ready for QA in Community Backlog Mar 27, 2020
@sudheers-kensium sudheers-kensium self-assigned this Mar 27, 2020
@m2-assistant
Copy link

m2-assistant bot commented Mar 27, 2020

Hi @sudheers-kensium. 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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.

@sudheers-kensium
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @sudheers-kensium. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @sudheers-kensium, here is your Magento instance.
Admin access: https://i-27469-2-4-develop.instances.magento-community.engineering/admin_9211
Login: 86df0572 Password: 502a99e4d5a9
Instance will be terminated in up to 3 hours.

@stkrelax
Copy link
Author

@sudheers-kensium thank for having a look. Any questions than just ask i will try to answer immediatly

@sudheers-kensium sudheers-kensium added Area: Frontend Component: CatalogInventory 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.4.x The issue has been reproduced on latest 2.4-develop branch labels Mar 27, 2020
@ghost ghost unassigned sudheers-kensium Mar 27, 2020
@ghost ghost moved this from Ready for QA to Ready for Dev in Community Backlog Mar 27, 2020
@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 Mar 27, 2020
@ghost ghost removed the Progress: ready for QA label Mar 27, 2020
@magento-engcom-team
Copy link
Contributor

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

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

@stkrelax
Copy link
Author

Adittional notice :
there is also a case where this happens when you have a product instock and qty 1
and inventory reservation totals -2 when cart qty is 1
Same case but other Messages.

@gwharton
Copy link
Contributor

#24191

@neerajchand
Copy link

@magento I am working on it

@m2-assistant
Copy link

m2-assistant bot commented Mar 27, 2020

Hi @neerajchand! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and self-assign the issue.

@madhurajawat madhurajawat self-assigned this Apr 17, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 17, 2020

Hi @madhurajawat. 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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.


@ghost ghost moved this from Ready for Dev to Dev in Progress in Community Backlog Apr 17, 2020
@madhurajawat
Copy link

@magento I need to fork MSI directory. Can you please provide the permission
Thanks.

@madhurajawat
Copy link

madhurajawat commented Apr 21, 2020

@stkrelax There is code added in InventorySales module di.xml. with this code getting 2 errors.
VirtualType " IsProductSalableForRequestedQtyConditionOnAddToCart "

<item name="is_any_source_item_in_stock" xsi:type="array">
	<item name="required" xsi:type="boolean">true</item>
	<item name="object" xsi:type="object">Magento\InventorySales\Model\IsProductSalableForRequestedQtyCondition\IsAnySourceItemInStockCondition</item>
</item>

We can remove this code.

@stkrelax
Copy link
Author

@madhurajawat will have a look at it

@stkrelax
Copy link
Author

sry we decided to disable msi. Other oversale reasons are the cause.

@ghost ghost moved this from Dev in Progress to Done (last 30 days) in Community Backlog Apr 28, 2020
@magento-engcom-team magento-engcom-team removed this from Done (last 30 days) in Community Backlog Apr 29, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.3.3 Indicates original Magento version for the Issue report. label Nov 13, 2020
@jtomaszewski
Copy link

jtomaszewski commented Dec 29, 2020

Uhm, what exactly happened here? Has it been fixed? If not, why did this issue has been closed?

It stills occurs at our Magento, 2.4.1 version.

@jtomaszewski
Copy link

jtomaszewski commented Dec 29, 2020

One of the errors is produced by this:

image

And the other by this:

image

The fix should probably be:

  • consolidate those validators into one, so that only one of them is fired, (or make one do the job of two), or
  • when adding "this product is out of stock" error message, do not add it, if one is already existant on it.

@NachoVidalGolosinas
Copy link

Anyone know any way to fix this?

@sprajapat770
Copy link

@NachoVidalGolosinas run this command in your database terminal.

INSERT IGNORE INTO inventory_source_item (source_code, sku, quantity, status)
select 'default', sku, qty, stock_status from (cataloginventory_stock_status as lg join catalog_product_entity as prd on((lg.product_id = prd.entity_id)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Component: CatalogInventory 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 Reported on 2.3.3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

No branches or pull requests

9 participants