i have this code

$productCollection = Mage::getModel('catalog/product')->getCollection();
            ->addAttributeToFilter('modelnumber', $params['modelnumber'])
            ->addAttributeToFilter('attribute_set_id', '10')

                'use_config_manage_stock' => 1,
                'is_in_stock' => 1,
                'qty' => 25


But i have error

 Call to undefined method Mage_Catalog_Model_Resource_Product_Collection::setStockData()

How i can save stockData ?


Please try with below code,

$stockData = ['qty' => 25, 'is_in_stock' => 1];


I hope its work for you.

Your Answer

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

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