Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Lost email notifications when orders are placed.


dculley

Recommended Posts

I'm running osc2.3.4 w/BS.  Last thing added was the update for KissIt images.  Some how I lost the email notifications when orders are being placed.  Config file is all set correctly in admin.  I don't think Kissit had anything to do with it.  Just that it stopped some time after that. 

 

Any ideas on where in the code that I need to look and how to fix?  My sales department would greatly appreciate the help.  (So would I)

 

 

 

 

Link to comment
Share on other sites

Hello Dean @@dculley,

 

As you say, KissIt Image Thumbnail shouldn't be related to that.

If all other e-mails are sent correct, there is the setting in:

Admin => Configuration => My Store => Send Extra Order Emails To

Check if an e-mail and the correct e-mail is filled in there.

 

Otherwise there can only be a problem in the order e-mail part of checkout_process.php lines 242-285.

Check if you modified somethinhg there.

 

regards

Rainer

Link to comment
Share on other sites

@@dculley It's a fairly common problem with some paypal modules so if the failure only occurs when paypal is used, installing the paypal app might help.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

I had installed PayPal standard V3.1., before going live and before installing other add ons, at the begging.  This is probably a dumb question,  is there a paypal "app" new version that I might need to upgrade to?  I'm not a programmer but for the most part get my self around.  

Link to comment
Share on other sites

@@raiwa

 

Hi Rainer,  I opened the checkout_process.php and it has been modified.  I know it is a lot to ask is there a way I can send you file to look at?  I have no idea what I'm looking for.  There is no rush.  If you find the problem I would like to know what it is so I will leave it alone in the future. 

 

Thanks

Dean

Link to comment
Share on other sites

@@dculley Dean I think Jack was referring to the PayPal App that you will find here.  It has been around for quite awhile now so be sure to check that you haven't installed it already.

 

Dan

Link to comment
Share on other sites

Hello Dan @@dculley,

 

First it would be very helpful to clear up the thrown questions:

- Do the other e-mails work correct: contact_us, create account confirmation, order status update from admin?

- Does the order confirmation mail to the customer work? I mean if only the additional order confirmation mail to the store owner doesn't work.

- Which is your exact OsCommerce version

- Which is your server platform (Windows-UNIX) and php version

- Does it work with other than PayPal payment modules?

- Did the order mails ever work before and do you remember what you changed before they began not to work any more?

 

Fo the PayPal question: if you are using paypal standard, there is no need to update to PayPal app (you can if you wish of course), the mentioned problem appears only with PayPal Express which uses it's own coding to send the order confirmation mails. PayPal standard uses the same as all other payment modules.

 

If your checkout_process.php is modified it is only relevant if the e-mail part I mentioned in the before message has been modified.

Of course you can post it here (the relevant part only please).

It should be this part:

  // lets start with the email confirmation
  $email_order = STORE_NAME . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
  if ($order->info['comments']) {
    $email_order .= tep_db_output($order->info['comments']) . "\n\n";
  }
  $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 
                  EMAIL_SEPARATOR . "\n" . 
                  $products_ordered . 
                  EMAIL_SEPARATOR . "\n";

  for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
  }

  if ($order->content_type != 'virtual') {
    $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 
                    EMAIL_SEPARATOR . "\n" .
                    tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
  }

  $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                  EMAIL_SEPARATOR . "\n" .
                  tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
  if (is_object($$payment)) {
    $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
                    EMAIL_SEPARATOR . "\n";
    $payment_class = $$payment;
    $email_order .= $order->info['payment_method'] . "\n\n";
    if (isset($payment_class->email_footer)) {
      $email_order .= $payment_class->email_footer . "\n\n";
    }
  }
  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  }

But, please answer first all the above questions!

 

regards

Rainer

Link to comment
Share on other sites

@@raiwa

 

HI Rainer - I really appreciate your help. I have created a test account and order.  Evan changed the status.

 

First it would be very helpful to clear up the thrown questions:

- Do the other e-mails work correct: contact_us, create account confirmation, order status update from admin?  Yes to all - even create order.

- Does the order confirmation mail to the customer work? I mean if only the additional order confirmation mail to the store owner doesn't work. Yes it did. 

- Which is your exact OsCommerce version 2.3.4 I according to Version checker.

- Which is your server platform (Windows-UNIX) and php version Linux 2.6 / http server apache 2.4.12 / php 5.4.43

- Does it work with other than PayPal payment modules? it seems to work with my take checks and WePay.

- Did the order mails ever work before and do you remember what you changed before they began not to work any more?  Yes off and on what I can tell.  Seems to be around paypal.  Or they are not clicking on the "continue" button.  That button should be in green and call Confirm or something else.  I would like to change the color to green back ground to make it stand out better. 

 

Here is the code

// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
  if ($order->info['comments']) {
    $email_order .= tep_db_output($order->info['comments']) . "\n\n";
  }
  $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 
                  EMAIL_SEPARATOR . "\n" . 
                  $products_ordered . 
                  EMAIL_SEPARATOR . "\n";

  for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
  }

  if ($order->content_type != 'virtual') {
    $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 
                    EMAIL_SEPARATOR . "\n" .
//BOF Better Checkout
( ( USE_BETTER_CHECKOUT == 'true' ) ? tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', "\n") : tep_address_label($customer_id, $sendto, 0, '', "\n") ) . "\n";
//EOF Better Checkout
  }

  $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                  EMAIL_SEPARATOR . "\n" .
//BOF Better Checkout
( ( USE_BETTER_CHECKOUT == 'true' ) ? tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', "\n") : tep_address_label($customer_id, $billto, 0, '', "\n") ) . "\n\n";
//EOF Better Checkout
  if (is_object($$payment)) {
    $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
                    EMAIL_SEPARATOR . "\n";
    $payment_class = $$payment;
    $email_order .= $order->info['payment_method'] . "\n\n";
    if (isset($payment_class->email_footer)) {
      $email_order .= $payment_class->email_footer . "\n\n";
    }
  }
  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  }

Thanks again for your help.

Dean

Link to comment
Share on other sites

Hello Dean @@dculley,

 

Then it's the known issue with paypal standard.

 

1. Enable "auto return for website payments" in your PayPal account:

My Profile => My Selling Tools => Website Preferences => Auto Return = On

THis will return them automatically after 10sec to the store without the need to click any button.

2. Add info text to the PayPal standard description, explaining that it is important to back to the store after payment, to finish the order. This should be shown on the checkout confirmation page, just before going to PayPal.

3. Like Dan mentioned, update to PayPal App. The standard version included there is more secure and uses Payment Data Transfer Identity Token. See included documentation.

 

If you still can't get rid off the unfinished orders/missing order mails, you should consider to use PayPal express.

It works different and there is no waiting to be backed or back to store button. The order is registered before going to PayPal and when they click the "Pay" button they are backed immediately to the store. It also offers options for guest checkout, they do not have to create an account in your store, the PayPal account data is used to create automatically a store account during checkout and payment.

 

Search the forum or Google for PayPal Express Checkout you'll find pleny of info.
 

Hope this helps

Rainer

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...