Is it possible to prevent a customer (under some circumstances) from checking out? I know it is possible to disable checkout from System >> Configuration >> Sales >> Checkout >> Checkout Options >> Disable Onepage Checkout.

I want to know if there's a way to disable checkout for a particular customer.

1 Answer 1


Try below code:


<?xml version="1.0"?>


<?xml version="1.0" ?>


class Supravatm_DisableCheckout_Model_Observer {

    public function disableCheckoutButton(Varien_Event_Observer $observer) {

        // Check if any customer is logged in or not
        if (Mage::getSingleton('customer/session')->isLoggedIn()) {

            //Load the customer's data
            $customer = Mage::getSingleton('customer/session')->getCustomer();
            if($customer->getEmail() == 'specify customer email') {
                $quote = Mage::getSingleton('checkout/session')->getQuote();
        return $this;

Alternate Process:

In your theme, edit the template file


there is code

<?php if ($this->isPossibleOnepageCheckout()):?>
    <button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
<?php endif?>

Alternative :

You will find this function isPossibleOnepageCheckout() in


You can extend this class and add your custom logic by which you can hide the checkout button.

Also in /Mage/Checkout/controllers/OnepageController.php

in indexAction()

write your condition so that user is redirected to cart page if condition is not fulfilled

  • 1
    Thanks. I changed controller_action_predispatch_checkout_cart_index to controller_action_predispatch to disable the checkout in every page, including direct access to checkout/onepage. Nov 2, 2017 at 9:09
  • that is make sense Nov 2, 2017 at 12:17

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.