Cannot Set Product Price Progamatically
Hi I have created a module that adds products through CSV.
All the attributes get populated apart from the price.
I am not sure where i am going wrong.
$product_node = new stdClass();
if (!empty($product['price']))
{
$product_node->commerce_price['und'][0]['amount'] = ($product['price'] * 100);
}
else
{
$product_node->commerce_price['und'][0]['amount'] = 0;
}
commerce_product_new($product_node);
commerce_product_save($product_node);
Please help