Magento News

 

Set Special Price Programatically In Magento

I am trying to write a script that will set a special price on a product with a start and an end date. When I run my script it does successfully set the special price, but the start and end date do not populate in the admin panel.

The code I am running is as follows:

$product = Mage::getModel('catalog/product')->load(114912);
$product->setSpecialPrice( ($product->getPrice() * .90)   );

$product->setSpecialFromDate('2010-11-01');
$product->setSpecialFromDateIsFormated(true);

$product->setSpecialToDate('2010-11-30');
$product->setSpecialToDateIsFormated(true);

$product->save();

Does anyone know what I am doing wrong here?

Thanks

Josh Pennington

Set Special Price Programatically In Magento

Possibly Related Posts:


 

Leave a Reply