Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Receive email notification when an order fails?


Recommended Posts

We occassionally have customers who call because they are not able to successfully complete an order. After several failures they are usually quite frustrated or angry.


I couldn't find a contribution or previous posting covering how to do this. Recover carts could help me find these after the fact, but I'd like to be able to contact the customer right when they're having the problem.


Anyone have any ideas.

Link to comment
Share on other sites

Unfortunately there are tons of reasons cart checkout might fail, and I suppose there might also be times when checkout appears to have failed but was actually successful. What might help you is to narrow down common checkout problems. If you know what you're looking for, you can check for it. Trying to write code that will catch all errors (human and machine) is a tall order.


If you're generally available or have someone that is, you might try a live chat link for checkout problems, or make sure your phone number is easily found during the checkout process. This might encourage people to contact you before they get frustrated.



Discount Coupon Codes


Link to comment
Share on other sites

I'm posting the following in case anyone researches this topic in the future.


Here's an approach that will send an email anytime the user receives an error message. Obviously this will yield too many message for a busy website, but it might be useful for a low volume website or during testing to determine what kind of problems users are having with the system.


The idea is that catalog/includes/header.php is responsible for printing error messages. Since header.php is called by all the main pages the following change will be applied system wide.


The standare tep_mail() function is used to send the email.




The $email_body and tep_mail lines below were added in the error printing section.


Note you will need to substitute your own email values to tep_mail



============== 2 new lines inserted around line 122 ====================



if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {


$email_body = sprintf($breadcrumb->trail('|')) . "\n" . sprintf(htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])));

tep_mail('to user name', 'to email address', 'subject desc', $email_body, 'from user', 'from email address');




<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="headerError">

<td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...