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 t
I have just tried your code on my catalog and it worked with a little adjustement.
You should pay attention to the loaded store;
it is not allowed to update certain product fields if the ADMIN store is not the currently loaded (Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
).
<?php
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
...
$product->save();
?>
This is just a guess but have you tried passing a timestamp like from time()
and leaving out the setSpecialFromDateIsFormated(true)
? That should cause the backend model to reformat it appropriately for you.