Here is my partial code

    $productObj = $objectManager->create('Magento\Catalog\Model\Product');
        $totalAdded ++;
        $productObj->setName($value->product_name) // Use default        
        // ->setStoreId(39)
            // price in form 100.99

        ->setAttributeSetId(9) //ID of a attribute set named 'default'

        //->setSpecialPrice($var_val->min_price) //special price in form 11.22
        ->setSku($var_val->sku."-".$var_val->variant_id) //SKU        
            'use_config_manage_stock' => 0, //'Use config settings' checkbox
            'manage_stock'=>1, //manage stock
            'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
             //Maximum Qty Allowed in Shopping Cart
            'is_in_stock' => 1, //Stock Availability
            'qty' => $var_val->quantity //qty


after adding product price is not getting stored in backend and showing 0 in frontend.

1 Answer 1


Please use setFinalPrice(100.99) instead of setPrice(100.99).

I hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.