Closed
Description
Preconditions
- Magento version - 2.1.0
Steps to reproduce
- I was attempting to get the stock status of a product using \Magento\Store\Model\StoreManagerInterface getProductsStockStatuses(). This function requires you to pass productIds and the website id.
- The returned array for all items was coming back empty.
Expected result
- The returned array should contain the stock status (instock 1 out of stock 0) of the product.
Actual result
- An empty array is being returned. I have looked in the cataloginventory_stock_status table and can see that the website id is set to 0. See image.
If I look into the catalog_product_website table the website id used is 1.
Should the website_id be set to 1 for the first website in the cataloginventory_stock_status?