Skip to content

Cannot save qty for custom product type #8764

@springimport

Description

@springimport

Steps to reproduce

  1. Create custom product type like skuitem. Example.
  2. Create skuitem product in admin.
  3. Try to set Qty to xxx.

Expected result

  1. Qty is xxx.

Actual result

  1. Qty is 0 always for custom product type (skuitem).

qty

Print request in \vendor\magento\module-catalog\Controller\Adminhtml\Product\Save.php
print_r($this->getRequest()->getParams());exit;


Array
(
    [id] => 22423
    [type] => skuitem
    [store] => 0
    ...
    [product] => Array
        (
            [status] => 1
            [name] => Test2
            [sku] => Test2
            [price] => 50.00
            [quantity_and_stock_status] => Array
                (
                    [is_in_stock] => 1
                    [qty] => 555
                )

            [visibility] => 4
            [url_key] => test2
            [meta_title] => Test2
            [meta_keyword] => Test2
            [meta_description] => Test2 
            [options_container] => container2
            [gift_message_available] => 1
            [current_product_id] => 22423
            [stock_data] => Array
                (
                    [item_id] => 17020
                    [product_id] => 22423
                    [stock_id] => 1
                    [qty] => 0
                    [min_qty] => 0
                    [use_config_min_qty] => 1
                    ...
                    [type_id] => skuitem
                    ...
                )
            ...
        )
    ...
)

I think problem with a [stock_data][qty] => 0. In simple product [stock_data][qty] always correctly. What could be a problem?

Q A
Magento version 2.1.5 with sample data
PHP version 7 x64
Operating system Windows 10 x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions