I have made a custom attribute blacklisted in the customer grid. I have created the attribute directly from phpmyadmin.

I will blacklist customers manually.

Now, while placing an order, if, for the customer, blacklisted='Yes', he should not be able to place order. I want to check this attribute using the customer's email id.

How can I achieve this?

2 Answers 2


I like this question but I would use a different approach.

Firstly I would create a customer group called blacklisted then use the following code to display or hide content as needed.

$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
$group = Mage::getModel('customer/group')->load($groupId);  
if(Mage::getSingleton('customer/session')->isLoggedIn() && $group->getCode()=="blacklisted"):
  • Using this approach, how can I bar him from placing any further orders ? Mar 3, 2017 at 5:36
  • You could wrap it around the place order button or even the whole checkout so the page looks totally different to blacklisted customers and then display a warning message. Mar 3, 2017 at 8:11
  • okay. Thank you for the help. Your idea of creating a group is superb :) Mar 3, 2017 at 8:36

You have to create an observer method and call it on the event sales_order_place_before.

In this method you can get the customer id from session and load that customer. Now you will get all the attribute value of customer.

If its blacklisted then return false.

You can follow this link to create observer on event.

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.