Set Special Price Programatically In Magento


require_once('app/Mage.php');

Mage::app()
      ->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$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);
<span style="font-family: Consolas, Monaco, monospace;">
$product->save();

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s