Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Simple Conditional Text to Confirmation eMail


DataMouse

Recommended Posts

Hi all

 

I'd like to add a piece of text to the outgoing confirmation email when a customer's total order is zero.

 

I have many free downloads on my site and would like to send a "Please offer a donation, you cheap leech"-type of message to these "customers".

 

I pretty sure that it will require some sort of DEFINE function in the laguages/english/checkout-process.php file.

However, i don't know where to add the condition.

 

Can anyone help, please?

 

Thanks all.

 

Danny

DataMouse

Link to comment
Share on other sites

I think this will work.....

 

In your language files (/catalog/includes/languages/[iNSERT EACH LANGUAGE YOU SUPPORT HERE]/checkoout_process.php ) make an entry like this:

 

define('EMAIL_TEXT_DONATE', 'Please offer a donation.');

Then in your /catalog/checkout_process.php, find this code:

 

  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

Replace it with this:

 

  if ( $total_cost < 0.01 ) {
$email_order .= EMAIL_TEXT_DONATE . "\n";
 }

 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the delay - didn't get any notifications on the topic...

 

This solution worked perfectly.

 

Thanks ever so much

 

Danny

Link to comment
Share on other sites

I was just wondering if Danny made a donation or was a "cheap leech". :-)

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

I was just wondering if Danny made a donation or was a "cheap leech". :-)

I'm expecting a check in the mail any day now.....

;)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I was just wondering if Danny made a donation or was a "cheap leech". :-)

Fair's fair.

I'm actually working on some graphics for osc (as the default ones are a little lame).

Will post as a contribution shortly

:blush:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...