Right, looks like I have to answer it myself. After few days of struggle I came to use observer to achieve this.
So decided to run a daily cron to check if there are any special price to date
for any product within my category and then do the business logic.
Cron runs everyday at the midnight.
My observer.php
public function scheduledChangePrice()
{
$category_id = 132;
$products = Mage::getModel('catalog/category')->load($category_id)
->getProductCollection()
->addAttributeToSelect('*') // add all attributes - optional
->addAttributeToFilter('status', 1) // enabled
->addAttributeToFilter('visibility', 4) //visibility in catalog,search
//->setOrder('price', 'ASC')
; //sets the order by price
$i = 0;
//$product = Mage::getModel('catalog/product')->load(3338);//(3389);
foreach($products as $product){
$i++;
if($product->getSpecialToDate() && ($product->getSpecialToDate() . ' 11:59:59 PM') <= $this->getCurrentDateTime()){
$product
->setSpecialPrice($product->getSpecialPrice() + 5) //add $5 to special price so it falls to higher sale price
->setSpecialToDate(null) //remove special to date so that cron doesn't run again
->save();
}
}
}
public function getCurrentDateTime($_storeId = null, $_format = 'm/d/y H:i:s') {
if (is_null($_storeId)) {
$_storeId = Mage::app()->getStore()->getId();
}
$storeDatetime = new DateTime();
$storeDatetime->setTimezone(new DateTimeZone(Mage::getStoreConfig('general/locale/timezone', $_storeId)));
return $storeDatetime->format($_format);
}
Hope this will help someone.