diff --git a/commerce_discount_firsttime.module b/commerce_discount_firsttime.module
index df23097..589f489 100644
--- a/commerce_discount_firsttime.module
+++ b/commerce_discount_firsttime.module
@@ -11,8 +11,18 @@ function commerce_discount_firsttime_customer_build(EntityDrupalWrapper $wrapper
   $uid = $wrapper->uid->value();
 
   // If user is anonymous validate discount.
-  if ($uid === '0') {
-    return ($anonymous_checkout_discount == 1) ? TRUE : FALSE;
+  if ($uid == 0) {
+    if ($wrapper->mail->value() !== '') {
+      // Get given total order amount.
+      $sql = 'SELECT COUNT(uid) FROM {commerce_order} WHERE mail = :mail';
+      $total_orders = db_query($sql, array(':mail' => $wrapper->mail->value()))->fetchField();
+  
+      // If user has 1 or fewer orders.
+      return ($total_orders <= 1) ? TRUE : FALSE;
+    }
+    else {
+      return ($anonymous_checkout_discount == 1) ? TRUE : FALSE;
+    }
   }
   else {
     // Get given total order amount.
