Am designing one restaurant website and their delivery time 10:00 Am to 10:00 Pm. How to make customers to placing order after the working hours. Is there any simple way?

1 Answer 1


You can use sales_order_place_before event to stop placing order after a specific time.

In your config (this is part of config.xml)


In your observer you can have this function:

public function stopOrder($observer)
    $order = $observer->getEvent()->getOrder();
    $address = $order->getShippingAddress();
    $postCode = $address->getPostcode();
    $currentTime = Mage::getModel('core/date')->date('Y-m-d H:i:s');

    // make your timing conditions... i just give the example of if() condition.

    if($currentTime <= 10:00:00 am || $currentTime >= 10:00:00 pm )
       Mage::getSingleton('checkout/session')->addError('Store has been closed');


I haven't tested but this should do the trick for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.