Reputation: 121
$p = Mage::getModel("catalog/product");
$p->setData("sku","real val sku111");
$p->setData("name","real val name");
$p->setData("price",21);
$p->setData("custom_attr","real val");
$p->save();
I couldn't save price with that code. It saves all other attribute value but when I check in admin panel, price column is always empty. I couldn't find out why. Could you help me?
Upvotes: 3
Views: 911
Reputation: 501
Try this:
$product = Mage::getModel('catalog/product');
$product->setSku('testsku61')
->setName('test product21')
->setPrice(21);
$product->save();
Upvotes: 1