Skip to content

Catalog Inventory using 0 as website ID #7090

Closed
@lhsatch

Description

@lhsatch

Preconditions

  1. Magento version - 2.1.0

Steps to reproduce

  1. 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.
  2. The returned array for all items was coming back empty.

Expected result

  1. The returned array should contain the stock status (instock 1 out of stock 0) of the product.

Actual result

  1. 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.
    stockstatuswebsite
    If I look into the catalog_product_website table the website id used is 1.

catalog_product_website

Should the website_id be set to 1 for the first website in the cataloginventory_stock_status?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions