Finally found my own solution by adding an Observer event.
sales_order_place_after
can change product price after placing the order if the stock is less than minQtyApplicableForSpecialPrice
.
public function salesOrderAfterSave(Varien_Event_Observer $observer)
{
$order = $observer->getEvent()->getOrder();
$cartItems = $order->getQuote()->getAllVisibleItems();
foreach ($cartItems as $item) {
$productId = $item->getProductId();
$product = Mage::getModel('catalog/product')->load($productId);
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
$stockQuantity=$stock->getQty();
$attribute_code='minimum_qty_for_special_price';
$minimumQuantity = $product->getResource()->getAttribute($attribute_code)->getFrontend()->getValue($product);
$date = Mage::getModel('core/date')->date('Y-m-d h:i:s');
$previousDate = Mage::getModel('core/date')->date('Y-m-d h:i:s', strtotime($date." -1 days"));
if (($stockQuantity - $minimumQuantity) < 0){
$product->setSpecialToDate($previousDate);
Mage::app()->setCurrentStore(0);
$product->save();
}
}
return $this;
}
What I did is, by changing special price date to the previous date. so that, special price will not show up if the stock is less than minimum quantity required. Hence the actual price will be displayed for products that have stock less than minimum quantity.