Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Send_order_html_email


Elazar

Recommended Posts

  • Replies 344
  • Created
  • Last Reply

Top Posters In This Topic

Having a little bug around here

 

need some help plz

 

I installed this mod

 

and whem i update status

 

two strange chars appears on the comments area in the message that goes out for the client.

 

i´ve searched the code and cannot find any wrong in it...

 

i put an arrow on image to where the strange chars appear.

 

See image plz

codigo.png

 

 

tks in advance

Link to comment
Share on other sites

Having a little bug around here

 

need some help plz

 

I installed this mod

 

and whem i update status

 

two strange chars appears on the comments area in the message that goes out for the client.

 

i´ve searched the code and cannot find any wrong in it...

 

i put an arrow on image to where the strange chars appear.

 

See image plz

codigo.png

 

 

tks in advance

From memory, that is in one of the language files and just needs to be deleted. Think it has been discussed before.

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I installed contribution: "Timezone Offset Module"

 

The installation is:

Contribution: Timezone Offset Module

Designed for: Zen Cart v1.2.3 Release. Modified to work on osCommerce 2.2 MS2

Originally Designed for Zen Cart by: Neville Kerr [email protected]

Modified for osCommerce by: Dr_Lucas

License: under the GPL - See attached License for info.

Support: http://www.oscommerce.com/forums/index.php?showtopic=203878

 

========================================================

 

WHAT DOES THIS MODULE DO?

 

This module allows you to set a time zone offset into the cart if you are in a situation where your store is in a different time zone from the server on which it is hosted. (For example, your store is based in Australia but is hosted on a server in the USA.) This situation can become a problem for accounting because order dates will not be accurate for the store time zone.

The module will also make the entire store and admin display the right date and time of your real location.

 

The module inserts a new configuration key into the database that sets the value of the time zone difference. The offset value is set from Admin>Configuration>My Store>Time Zone Offset.

 

All orders will have their 'date_purchased' value corrected for the timezone difference when they are inserted into the database. This corrected value will be displayed on all admin pages, on the customer's 'My Account' page

 

========================================================

 

INSTALLATION

 

Step 1. Use phpMyAdmin or a similar db manager to run the query in paragraph 1 below. This will add the TIME_ZONE_OFFSET configuration key into your database.

 

Step 2. Make sure that you have BACKUP(!!!) copies of your original files.

 

Step 3. Modify the seven files as described below

 

Step 4. From your store admin panel, select Configuration>My Store. The new Time Zone Offset field should now be on that page: set the offset you require.

 

That's it: you're done!

 

========================================================

 

HISTORY:

 

10/Apr/2006 - Initial Release

01/Sep/2006 - Added support for order confirmation and status change emails as well as footer of site (Steps 4, 6, 9, 10, 11)

 

========================================================

 

FILE MODIFICATIONS:

 

includes/functions/database.php

admin/includes/functions/database.php

includes/languages/english.php

admin/includes/languages/english.php

includes/footer.php

admin/orders.php

checkout_process.php

 

=======================================================

1) RUN THE FOLLOWING SQL ON YOUR SQL DATABASE:

 

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Time Zone Offset', 'TIME_ZONE_OFFSET', '0', 'The time zone difference between your store and the server. Enter +h, 0 or -h where ''h'' is the number of hours. If your store time zone is ahead of the server time zone, use +', 1, 7, NULL, '0001-01-01 00:00:00', NULL, NULL);

 

 

2) Go to your Configuration -> My Store -> Time Zone Offset

and set the time difference between your server and your real location

 

 

3) FILE includes/functions/database.php

* Find:

case 'now()':

$query .= 'now(), ';

 

* Change To:

case 'now()':

// Added a time offset function here

$query .= 'date_add(now(), INTERVAL ' . TIME_ZONE_OFFSET . ' HOUR), ';

 

 

4) FILE includes/functions/database.php

* Find:

function tep_db_fetch_array($db_query) {

 

* Insert the following code BEFORE the line above:

function tep_db_datetime() {

$check_datetime_query = tep_db_query('select date_add(now(), INTERVAL ' . TIME_ZONE_OFFSET . ' HOUR) AS CurrTime');

$check_datetime = tep_db_fetch_array($check_datetime_query);

return $check_datetime['CurrTime'];

}

 

 

5) FILE admin/includes/functions/database.php

* Find:

case 'now()':

$query .= 'now(), ';

 

* Change To:

case 'now()':

// Added a time offset function here

$query .= 'date_add(now(), INTERVAL ' . TIME_ZONE_OFFSET . ' HOUR), ';

 

 

6) FILE admin/includes/functions/database.php

* Find:

function tep_db_fetch_array($db_query) {

 

* Insert the following code before the line above:

function tep_db_datetime() {

$check_datetime_query = tep_db_query('select date_add(now(), INTERVAL ' . TIME_ZONE_OFFSET . ' HOUR) AS CurrTime');

$check_datetime = tep_db_fetch_array($check_datetime_query);

return $check_datetime['CurrTime'];

}

 

 

7) FILE includes/languages/english.php

* Find:

@setlocale(LC_TIME, 'en_US.ISO_8859-1');

 

* Change To:

@setlocale(LC_TIME, 'en_US.ISO_8859-1');

putenv("TZ=Asia/Bangkok");

$lcl_date_time = date("Y-m-d H:i:s");

 

*** IMPORTANT: Please note that you should put your own time zone after the TZ=. I live in Bangkok, so I use the Asia/Bangkok timezone. Search google to find more time zones and the one that matches yours...

*** NEW ZEALAND users should put Pacific/Auckland

 

8) FILE admin/includes/languages/english.php

* Find:

@setlocale(LC_TIME, 'en_US.ISO_8859-1');

 

* Change To:

@setlocale(LC_TIME, 'en_US.ISO_8859-1');

putenv("TZ=Asia/Bangkok");

$lcl_date_time = date("Y-m-d H:i:s");

 

*** IMPORTANT: Please note that you should set your own time zone after the TZ=. I live in Bangkok, so I use the Asia/Bangkok timezone. Search google to find more time zones and the one that matches yours...

*** NEW ZEALAND users should put Pacific/Auckland

 

 

9) FILE includes/footer.php

* Find:

<td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>

 

* Change To:

<td class="footer">  <?php $date_time = tep_db_datetime(); echo strftime(DATE_FORMAT_LONG, strtotime($date_time)); ?>  </td>

 

 

10) FILE admin/orders.php

* Find:

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");

 

* Change To:

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");

 

 

* Find:

tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

*Change To:

tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR) where orders_id = '" . (int)$oID . "'");

 

 

11) FILE checkout_process.php

* Find:

// lets start with the email confirmation

 

* Insert the following AFTER the above line

$date_time = tep_db_datetime();

 

* Find:

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

 

*Change To:

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG, strtotime($date_time)) . "\n";

 

 

12) That's it. There are still many places in osCommerce which use the now() SQL function but the most obvious ones are fixed here.

 

You can pretty much change occurrences of

now()

to

date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR)

but backup your files before you make changes and test straight away. The only exception to this is when fields are assigned to an array and the tep_db_perform function is called straight after. If in doubt, leave as is.

 

If you do change these, be aware that " and ' can be used as string delimiters. Use the correct one between the . TIME_ZONE_OFFSET . for each case.

 

 

Now, there is an instruction part 11, to modify the email sent to the customer.

Which is:

 

11) FILE checkout_process.php

* Find:

// lets start with the email confirmation

 

* Insert the following AFTER the above line

$date_time = tep_db_datetime();

 

* Find:

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

 

*Change To:

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG, strtotime($date_time)) . "\n";

 

I would like please to modify the "Send_order_html_email" to send the similar "Date format" like this:

 

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG, strtotime($date_time)) . "\n";

 

Where I need to change the code ??

 

Could someone please make my day??

 

Best Regards,

 

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

Hello, I've got this great contribution working because of all the reactions on this topic.

Only having a major problem for wich I can't find the solution.

 

After a new customer creates an account he/she receives an confirmation email, normally.

 

But in my case they only receive the following text;

 

VARTABLE1

VARLOGO

VARTABLE2 EMAILGREET_MS

 

EMAILWELCOMEEMAILTEXTEMAILCONTACTEMAILWARNING

EMAIL_TEXT_FOOTER

 

Is there anyone who has the solution to this problem?

Link to comment
Share on other sites

Hello, I've got this great contribution working because of all the reactions on this topic.

Only having a major problem for wich I can't find the solution.

 

After a new customer creates an account he/she receives an confirmation email, normally.

 

But in my case they only receive the following text;

 

VARTABLE1

VARLOGO

VARTABLE2 EMAILGREET_MS

 

EMAILWELCOMEEMAILTEXTEMAILCONTACTEMAILWARNING

EMAIL_TEXT_FOOTER

 

Is there anyone who has the solution to this problem?

 

 

Hi,

 

It seems like you didn't complete all the installation instructions.

 

It looks like that you didn't modify the parts of the installation that related to the langauges modification.

 

Check step by step again, where you missed..

 

Let us know..

 

Regards,

 

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

Hi,

 

Could someone help please?

 

These variables:

 

Firstname Lastname

Streetname 0

Postalcode

Country

 

Are not language supported in send_order_html_email contribution..

 

What I need to modify to make them supported multi languages ?

 

Thanks,

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

Hi,

 

Could someone help please?

 

These variables:

 

Firstname Lastname

Streetname 0

Postalcode

Country

 

Are not language supported in send_order_html_email contribution..

 

What I need to modify to make them supported multi languages ?

 

Thanks,

Nathali

 

 

Sorry.. It supports it !!

Best Regards,

Nathali

Link to comment
Share on other sites

  • 2 weeks later...
Billing name and address do not show in hlml emails.

Any ideas?

If the information exists in the database, it should show. Do they show on non html emails? All I can suggest is recheck your installation.

Link to comment
Share on other sites

Leslie,

 

Could you point me to sample images of the HTML email messages with and without the row_mod_additions modification please.

 

Or maybe send me a couple sample emails?

 

Thank you,

Gaver

diplomacy is the art of saying "nice doggie" - while you look for a rock.

Link to comment
Share on other sites

  • 3 weeks later...

Hello all, i have installed this excellent contrib and am wondering...is there a way that the store owner can get an email of the order as well. I am running a print store and need to know when an order is placed so i can get the files on the press.

Link to comment
Share on other sites

  • 3 weeks later...
Hello all, i have installed this excellent contrib and am wondering...is there a way that the store owner can get an email of the order as well. I am running a print store and need to know when an order is placed so i can get the files on the press.

 

Therefore you have to set up in admin -> configuration -> my store the field send extra orders emails to with the recipient you wish to gat the order mail copy. thats all

Link to comment
Share on other sites

Hello, I've got this great contribution working because of all the reactions on this topic.

Only having a major problem for wich I can't find the solution.

 

After a new customer creates an account he/she receives an confirmation email, normally.

 

But in my case they only receive the following text;

 

VARTABLE1

VARLOGO

VARTABLE2 EMAILGREET_MS

 

EMAILWELCOMEEMAILTEXTEMAILCONTACTEMAILWARNING

EMAIL_TEXT_FOOTER

 

Still haven't found a solution for this problem.

Modified two different stores with it (from scratch) and both of them give the same error.

The rest of the html mails work fine but only the confirmation email after creating a new account gives this error.

 

Someone a solution?

Link to comment
Share on other sites

Still haven't found a solution for this problem.

Modified two different stores with it (from scratch) and both of them give the same error.

The rest of the html mails work fine but only the confirmation email after creating a new account gives this error.

 

Someone a solution?

did you do the required edits in includes/languages/english/create_account.php

Link to comment
Share on other sites

I've read the enclosed manuel several times and there's nothing about includes/languages/english/create_account.php. The only file I can find in the manuel that needs changing is catalog/create_account.php

So, probably there is something missing. I'm using 'Send HTML Email V2' with Os 2.2 RC2a.

Link to comment
Share on other sites

I've read the enclosed manuel several times and there's nothing about includes/languages/english/create_account.php. The only file I can find in the manuel that needs changing is catalog/create_account.php

So, probably there is something missing. I'm using 'Send HTML Email V2' with Os 2.2 RC2a.

Number 4

 

Something like catalog/includes/languages/english/

create_account.php Insert at the end of the file lines 28 - 59 from the modified /includes/languages/english/ create_account.php file.

 

FYI, I have

 

//BEGIN SEND HTML MAIL//

// Email style

define('STORE_LOGO', 'coopco_header.gif'); //Your shop logo (location: /catalog/images).

define('BG_TOP_EMAIL', 'pixel_trans.gif'); //Background image.

define('COLOR_TOP_EMAIL', '#999999'); //Background color of the email header (only visible if no background image)

define('BG_TABLE', 'pixel_trans.gif'); //background image of the email body

define('COLOR_TABLE', '#f9f9f9'); //background color of the email body (only visible if no background image)

 

 

//Account Gender True:

//define('EMAILGREET_MR', '<b>Dear Mr. ' . stripslashes($HTTP_POST_VARS['lastname'].'</b') . "\n");

define('EMAILGREET_MR', '<b>Dear Mr. ' . stripslashes($HTTP_POST_VARS['firstname'] . ' ' . $HTTP_POST_VARS['lastname'].'</b>') . "\n");

//define('EMAILGREET_MS', '<b>Dear Ms. ' . stripslashes($HTTP_POST_VARS['lastname'].'</b>') . "\n");

define('EMAILGREET_MS', '<b>Dear Ms. ' . stripslashes($HTTP_POST_VARS['firstname'] . ' ' . $HTTP_POST_VARS['lastname'].'</b>') . "\n");

//Account Gender False:

define('EMAILGREET_NONE', '<b>Dear ' . stripslashes($HTTP_POST_VARS['firstname'] . ' ' . $HTTP_POST_VARS['lastname'].'</b>') . "\n");

 

//Email Body

define('EMAILWELCOME', 'We welcome you to ' . STORE_NAME . ', and thank you for creating an account with us.' . "\n\n");

// Start Welcome Email username & password

define('EMAILUSERNAME', 'Your username is: <b>' . stripslashes($HTTP_POST_VARS['email_address']) . '</b>' . "\n\n");

define('EMAILPASSWORD', 'Your password is: <b>' . stripslashes($HTTP_POST_VARS['password']) . '</b>' . "\n\n");

// End Welcome Email username & password

define('EMAILTEXT', 'We suggest that you save or print this e-mail for future reference. Keep it in a safe place. Both your username and password are case sensitive.'."\n\n". 'You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");

define('EMAILCONTACT', 'For help with any of our online services, please email ' . STORE_NAME . ': ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n" . 'We will be pleased to help you learn more about our products and services.<br>' . "\n\n");

define('EMAILWARNING', '<b>Note:</b> You are receiving this email if you created an account at '. STORE_NAME . '. If you did not wish to create an account, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");

 

//Email Footer.

define('EMAIL_SEPARATOR', '' . "\n"); //Define Email Separator

define('EMAIL_TEXT_FOOTER', '<br><br>Copyright © ' . date('Y') . '<br>'); //Footer Text

 

 

// Prepare Variables

define('VARSTYLE', '<link rel="stylesheet" type="text/css" href="stylesheetmail.css">'); //location of email css file.

define('VARHTTP', '<base href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'); //Do not change

define('VARLOGO', ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '"><IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . STORE_LOGO .'" border=0></a> '); //Define Logo location. DO NOT CHANGE

define('VARTABLE1', '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="' . COLOR_TOP_EMAIL . '" background="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . BG_TOP_EMAIL . '" > ' ) ; //Header Table

define('VARTABLE2', '<table width="100%" border="0" cellpadding="3" cellspacing="3" bgcolor="' . COLOR_TABLE . '" background="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . BG_TABLE . '">'); //Body table formatting

 

//END SEND HTML MAIL//

 

but I may have modified it.

Link to comment
Share on other sites

Hello Coopco,

 

Thanks very much for your reply. You put me in the right direction. In y manuel ther was nothing about "create account"changes.

So I downloaded the latest version and opened the manuel and there was the section describing how to change the create account.php.

 

Everything is working fine now.

 

Thanks for your help.

Link to comment
Share on other sites

  • 2 weeks later...

I just installed this great add-on, but faced with one problem.

 

I'm using PayPal IPN and the order email is sent from a different file (ext\modules\payment\paypal_ipn\ipn.php)

so it's still sending out text emails.

 

Is there a way to overcome this?

 

Thanks,

 

Susan

Link to comment
Share on other sites

the contribution suxx i installed and stylesheetmail not work, he didn't recognize , after hours of fixing, searching, nothing works, it's bullshit

 

The contribution works fine and also the stylesheets maybe that you have made something wrong - but this didnt mean that the contribution sucks ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...