Closed menacoders closed 3 years ago
Hi @MagentoAr. Thank you for your report. To help us process this issue please make sure that you provided the following information:
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-engcom-team give me 2.3-develop instance
- upcoming 2.3.x release
For more details, please, review the Magento Contributor Assistant documentation.
@MagentoAr do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
Hi @AlexWorking. 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: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If 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
branchDetails
- Add the comment @magento-engcom-team 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. Verify that the issue is reproducible on 2.2-develop
branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop
branch, please add the label Reproduced on 2.2.x
[ ] 6. Add label Issue: Confirmed
once verification is complete.
[ ] 7. Make sure that automatic system confirms that report has been added to the backlog.
Hi @AlexWorking thank you very much for working on this issue. i'll waiting your updates.
@AlexWorking @vteofilo
any help in this issue would be great.. it's urgent problem in our store .
Thanks & Regards
@MagentoAr , please look at my solution:
https://github.com/magento/magento2/issues/15201#issuecomment-417867348
Hope this helps!
@vteofilo thank you but i really don't know where to put your code.
Can you find the StockRegistry.php class?
@vteofilo thank you but i really don't know where to put your code.
Can you find the StockRegistry.php class?
yes i found it on this path /vendor/magento/module-catalog-inventory/Model/StockRegistry.php
but i don't know wheres to put the code
You must override the syncProductStock method.
@vteofilo thank you but i really don't know where to put your code.
Can you find the StockRegistry.php class?
yes i found it on this path /vendor/magento/module-catalog-inventory/Model/StockRegistry.php but i don't know wheres to put the code
You must override the syncProductStock method.
i couldn't find any method called syncProductStock in this file /vendor/magento/module-catalog-inventory/Model/StockRegistry.php
@vteofilo any help would be great
Hello @MagentoAr
Thank you for the report!
We investigated this issue and as results:
Initially "/rest/V1/products?searchCriteria" API endpoint was developed for wider use and it should not returns only In Stock products by design. Even if you set "Stores > Configuration > Catalog > Inventory > Display Out of stock products No" the product will be available by direct URL on Storefront. I suppose it needs for SEO purposes and indexation by other systems. And because of that issue cannot be confirmed and proved for fix with described use case
But the real bug is "/rest/V1/products?searchCriteria" API endpoint" does not return information about stock in the "extension_attributes" section.
so, I updated Issue title and description with this information Are you ok with this?
:white_check_mark: Confirmed by @sdzhepa
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-99618
, MAGETWO-99619
were created
Issue Available: @sdzhepa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @milindsingh. 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
branchDetails
- Add the comment @magento-engcom-team 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. Verify that the issue is reproducible on 2.2-develop
branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop
branch, please add the label Reproduced on 2.2.x
[ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.
Hi @mallikaverma. 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
branchDetails
- Add the comment @magento-engcom-team 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. Verify that the issue is reproducible on 2.2-develop
branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop
branch, please add the label Reproduced on 2.2.x
[ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.
Hi Guys,
We're also experiencing this in a production setting. Any updates would be greatly appreciated.
Thanks!
✅ Confirmed by @sdzhepa Thank you for verifying the issue. Based on the provided information internal tickets
MAGETWO-99618
,MAGETWO-99619
were createdIssue Available: @sdzhepa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
But we are still not able to find if product available in stock or not, there is no parameter in search result that shows whether the product available in stock or out of stock
Hello @MagentoAr
Thank you for the report!
We investigated this issue and as results:
- Initially "/rest/V1/products?searchCriteria" API endpoint was developed for wider use and it should not returns only In Stock products by design. Even if you set "Stores > Configuration > Catalog > Inventory > Display Out of stock products No" the product will be available by direct URL on Storefront. I suppose it needs for SEO purposes and indexation by other systems. And because of that issue cannot be confirmed and proved for fix with described use case
- But the real bug is "/rest/V1/products?searchCriteria" API endpoint" does not return information about stock in the "extension_attributes" section.
so, I updated Issue title and description with this information Are you ok with this?
But we are still not able to find if product available in stock or not, there is no parameter in search result that shows whether the product available in stock or out of stock.
any news about this issue?
any news about this issue?
@scne it's still not fixed in any version i have built a module to solve this issue, i'll share it with you these days.
Hi @scne i have uploaded the module, get it from here https://github.com/menacoders/Stock-Info-API-searchCriteria
and let me know if you need anything else 👍
Hi @menacoders thank you so much for your help! I'm using Magento 2.3.2, is your code compliant?
Hi @menacoders thank you so much for your help! I'm using Magento 2.3.2, is your code compliant?
yes, i have build it for m2.3.x
Hi @scne i have uploaded the module, get it from here https://github.com/menacoders/Stock-Info-API-searchCriteria
and let me know if you need anything else
Thank you. One question, how can we filter out these out-of-stock products from the API result?
Hi @scne i have uploaded the module, get it from here https://github.com/menacoders/Stock-Info-API-searchCriteria and let me know if you need anything else
Thank you. One question, how can we filter out these out-of-stock products from the API result?
@titechnologies you are welcome.
you mean, you only want to return the in_stock products ? if that what you want.. you could use this api
rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=quantity_and_stock_status&searchCriteria[filter_groups][0][filters][0][value]=2
just add the quantity_and_stock_status filter so it's will return the in_stock products instock value = 2 outofstock value = 1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!
Preconditions
Steps to reproduce
/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=35&searchCriteria[current_page]=1&searchCriteria[page_size]=40
Expected result
Actual result