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
Magento 2.4.2 inventory-configurable-product-frontend-ui shows "Only 0 left" when variation product is in stock #3276
Comments
Hi @gaiterjones. Thank you for your report. Please, add a comment to assign the issue:
|
I have the same problem, The type configurable product with variation has been added, On the front, the product is available, when I click on the variant, the message: "Only 0 left" I tried to change the configuration to no avail. The main product is set to On, Available. Each product belonging to the configuration has an inventory 10, it is turned on. My problems are identical to those described above |
There doesn't seem to be much interest in this issue at the moment it's pretty easy to fix in the js but the easiest way to work around it is to disable the module.
|
Can you give me your solution how I solved this problem edit the code? I can code in php and a bit in JS, but I can't handle it. |
When I disable the Magento_InventoryConfigurableProductFrontendUi module I get an error for a configurable product. On the front, the options for available variants have disappeared, after adding the product to the cart without selecting a variant, an error appears with the message: You must select options with the product. There were JS errors in the Chrome console: require.js: 141 Uncaught Error: Script error for: configurableVariationQty |
@adigame you can try extending/updating vendor/magento/module-inventory-configurable-product-frontend-ui/view/frontend/web/js/configurable-variation-qty.js at line 32 change
to
This is a workaround that will stop the incorrect returned value of 0 from showing the stock message. |
@gaiterjones this #3276 (comment) it helped me a lot, thank you for your help. |
You could also just replace that module completely for now by adding to your
After |
I think the issue is coming from GetProductQtyLeft class. vendor/magento/module-inventory-catalog-frontend-ui/Model/GetProductQtyLeft.php It can be replaced with the following:
|
Instead of hiding it, is there a potential fix that will properly show the quantity when the option is selected? |
The less invasive way to hide the message is editing the file THIS IS NOT A SOLUTION! |
It works for me to get the 0 stock away, but I prefer the right number of stock for our B2B shop. |
Issue reproduced in 2.4.2-p1 |
Hi @kamanivardhman! 👋 |
@magento I check the whole issue and The issue is fixed. Here is the pull request 337f8b7#diff-3f538d466d079fb270c25ba797de6eae883621a534997a58de77551b095df1ab |
The desktop has disappeared, but the mobile has not disappeared |
what about in vendor/magento/module-inventory-configurable-product-frontend-ui/view/frontend/web/js/configurable-variation-qty.js from |
Issue reproduced in 2.4.2-p1 after upgrading from Magento 2.3.5. Tried @MarekCernak solution worked for me. |
I'm still dealing with same issue in 2.4.6 None of the "fixes" worked only to hide from stockQty. I'm still getting Only %1 Left, anyone fixed in another way? |
Bump. Issue still persists. 2.4.6-p2 |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
module-inventory-catalog-frontend-ui shows "Only 0 left"
The js in configurable-variation-qty.js only hides the element when a null value is returned, if the logic in IsSalableQtyAvailableForDisplaying returns false GetProductQtyLeft can only return a float (0.0) the js then displays this as the available qty.
GetProductQtyLeft should probably return null if the "Only X left" should not be displayed.
The text was updated successfully, but these errors were encountered: