Skip to content

Imported bundle products are not assigned stock status #12330

@indefinitedevil

Description

@indefinitedevil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: ImportExportFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions