Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Imported bundle products are not assigned stock status #80

@piotrekkaminski

Description

@piotrekkaminski

From @indefinitedevil on November 17, 2017 13:2

When importing a new bundle product (can be entirely new, or generated through replacement), no entry is generated for it in cataloginventory_stock_status. This means that when the frontend tries to display it, it encounters a NULL entry when trying to discover whether the product is salable.

vendor/magento/module-catalog/Model/Product/Type/AbstractType.php line 355
When running getData('is_salable'), this returns NULL because the cataloginventory_stock_status row doesn't exist. Because it returns NULL, the isSalable function returns false, and that means that the bundle product does not appear in category lists and shows as out of stock on the frontend.

Reindexing does not resolve issue, and neither does saving the product in the backend.

Preconditions

  1. Magento Commerce 2.2.0
  2. PHP 7.0.23 / 7.1.11 (tested on two servers)
  3. MySQL 5.6.37 / MariaDB 10.2.7

Steps to reproduce

  1. Create bundle product that shows on frontend as in stock
  2. Export bundle product
  3. Either:
    3.a) change the SKU of the bundle product and import it
    3.b) re-import it in Replace mode

Expected result

  1. New/replaced product shows as in stock

Actual result

  1. New/replaced product shows as out of stock

Copied from original issue: magento/magento2#12330

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions