I am using Magento 2.2.5 creating simple product programmatically. But qty value not getting saved, In stock status of product is working fine using below code but every time Qty field is blank

$product = $this->_productFactory->create();
    ->setName('Simple Product')
    ->setShortDescription("Short description")
    ->setDescription('Description with <b>html tag</b>')
    ->setMetaTitle('meta title')
    ->setMetaKeyword('meta keyword')
    ->setMetaDescription('meta description')
            'use_config_manage_stock'   => 1,
            'qty'                       => 100,
            'is_qty_decimal'            => 0,
            'is_in_stock'               => 1,

any help would be much appreciated. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.