Whiskers Posted February 5, 2010 Share Posted February 5, 2010 Did you entered an email address into thr field "send extra order emails to" in admin? Do you receive new order emails? Yeah the email address has always been there. I just re-entered it to make sure. I receive new order emails fine. Weird. Link to comment Share on other sites More sharing options...
♥multimixer Posted February 5, 2010 Author Share Posted February 5, 2010 Well, I don't know what you did. Can you post the lines of create_account.php that refer to the email? (please do not post the complete file and use the <code> tags) My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Whiskers Posted February 5, 2010 Share Posted February 5, 2010 Well, I don't know what you did. Can you post the lines of create_account.php that refer to the email? (please do not post the complete file and use the <code> tags) This is what I have including a bit above and below: $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // BOF multimixer 24.6.2009 send emails to other people $owners_text = EMAIL_TEXT_OWNER_INFO . "\r\n" .EMAIL_TEXT_CUSTOMER_NAME . ' ' . $name . "\r\n" . EMAIL_TEXT_CUSTOMER_EMAIL . ' ' . $email_address . "\r\n" . EMAIL_TEXT_CUSTOMER_PHONE . ' ' . $telephone . "\r\n" . EMAIL_TEXT_CUSTOMER_ADDRESS . ' ' . $street_address . "\r\n" . EMAIL_TEXT_CUSTOMER_CITY . ' ' . $city . "\r\n" . EMAIL_TEXT_CUSTOMER_STATE . ' ' . $state . "\r\n" . EMAIL_TEXT_CUSTOMER_COUNTRY . ' ' . $country; if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_OWNER_SUBJECT, $owners_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // EOF multimixer tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); } } Link to comment Share on other sites More sharing options...
♥multimixer Posted February 5, 2010 Author Share Posted February 5, 2010 This is what I have including a bit above and below: Ok, clear now. You have the necessary code all in one line and commented out. So the code is inactive. What kind of editor you use? change this // BOF multimixer 24.6.2009 send emails to other people $owners_text = EMAIL_TEXT_OWNER_INFO . "\r\n" .EMAIL_TEXT_CUSTOMER_NAME . ' ' . $name . "\r\n" . EMAIL_TEXT_CUSTOMER_EMAIL . ' ' . $email_address . "\r\n" . EMAIL_TEXT_CUSTOMER_PHONE . ' ' . $telephone . "\r\n" . EMAIL_TEXT_CUSTOMER_ADDRESS . ' ' . $street_address . "\r\n" . EMAIL_TEXT_CUSTOMER_CITY . ' ' . $city . "\r\n" . EMAIL_TEXT_CUSTOMER_STATE . ' ' . $state . "\r\n" . EMAIL_TEXT_CUSTOMER_COUNTRY . ' ' . $country; if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_OWNER_SUBJECT, $owners_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // EOF multimixer to this // BOF multimixer 24.6.2009 send emails to other people $owners_text = EMAIL_TEXT_OWNER_INFO . "\r\n" .EMAIL_TEXT_CUSTOMER_NAME . ' ' . $name . "\r\n" . EMAIL_TEXT_CUSTOMER_EMAIL . ' ' . $email_address . "\r\n" . EMAIL_TEXT_CUSTOMER_PHONE . ' ' . $telephone . "\r\n" . EMAIL_TEXT_CUSTOMER_ADDRESS . ' ' . $street_address . "\r\n" . EMAIL_TEXT_CUSTOMER_CITY . ' ' . $city . "\r\n" . EMAIL_TEXT_CUSTOMER_STATE . ' ' . $state . "\r\n" . EMAIL_TEXT_CUSTOMER_COUNTRY . ' ' . $country; if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_OWNER_SUBJECT, $owners_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // EOF multimixer My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Whiskers Posted February 5, 2010 Share Posted February 5, 2010 That's weird as when I open the file it is on different lines. I did just space them out exactly like you have though and it worked! Finally... but I got the email like this: EMAIL_TEXT_OWNER_INFO EMAIL_TEXT_CUSTOMER_NAME Kljghlkjh Jkhkjh EMAIL_TEXT_CUSTOMER_EMAIL myemail.com EMAIL_TEXT_CUSTOMER_PHONE EMAIL_TEXT_CUSTOMER_ADDRESS Kljhkljh EMAIL_TEXT_CUSTOMER_CITY Lkjhkljh EMAIL_TEXT_CUSTOMER_STATE ENGLAND - CUMBRIA EMAIL_TEXT_CUSTOMER_COUNTRY 222 Link to comment Share on other sites More sharing options...
♥multimixer Posted February 5, 2010 Author Share Posted February 5, 2010 So you need to go back and read what needs to be done at step 3 of the post My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Whiskers Posted February 5, 2010 Share Posted February 5, 2010 That's weird as when I open the file it is on different lines. I did just space them out exactly like you have though and it worked! Finally... but I got the email like this: EMAIL_TEXT_OWNER_INFO EMAIL_TEXT_CUSTOMER_NAME Kljghlkjh Jkhkjh EMAIL_TEXT_CUSTOMER_EMAIL myemail.com EMAIL_TEXT_CUSTOMER_PHONE EMAIL_TEXT_CUSTOMER_ADDRESS Kljhkljh EMAIL_TEXT_CUSTOMER_CITY Lkjhkljh EMAIL_TEXT_CUSTOMER_STATE ENGLAND - CUMBRIA EMAIL_TEXT_CUSTOMER_COUNTRY 222 Don't worry. It wasn't spaced out correctly. I use Notepad2 by the way. How can I get it so that phone is gone and I have an address line 1 and 2 like I have in create account? Also how come the country says 222, rather than UK? I only have the UK in the database, but I am thinking about putting other ones back in. Will this change it? Link to comment Share on other sites More sharing options...
vishkunal Posted February 6, 2010 Share Posted February 6, 2010 These Coding Seems Difficult to understand. Link to comment Share on other sites More sharing options...
Ironhalo Posted February 10, 2010 Share Posted February 10, 2010 Any suggestions for where to start when trying to fix the following: every email the stores sends, it sends twice. clients welcome email - twice comfirmation of order email - twice contact us form email to us - twice its very weird. the store uses smtp rather than send mail, as whnen i used send mail, only one email was sent, but it was a 50/50 shot to see if they got any email at all. so i decided that two emails were better than none. any suggestions would be greatly appreicated. AL Link to comment Share on other sites More sharing options...
modem2.0 Posted February 19, 2010 Share Posted February 19, 2010 Hi, I have a strange behavior in the contact us email. PHP is eating all line breaks the customer enters in the form. For example, the user writes: Hello I´m interesting in buying product xpto, but I have some questions regarding bla, bla, bla Kind regards, Customer and I receive: HelloI´m interesting in buying product xpto, but I have some questions regarding bla, bla, blaKind regards,Customer It is very difficult to read the received email, specially from people that only writes in CAPITAL LETTERS and don't use any punctuation. I'm wondering if someone knows where this issue might be coming from, and if there is a fix that does not compromise security. I made a search in the forum and in google and found nothing interesting. I'm using the default OSC contact us file, just with some modifications in HTML to provide more info to the customer, but I also tried the Super Contact Us contribution with the same result. I'm also wondering if this is not happening to anyone else. Regards, Link to comment Share on other sites More sharing options...
designbysue Posted February 26, 2010 Share Posted February 26, 2010 This is a very helpful post - thank you Can anyone expand on this and tell me how to make a field on the contact us form required - such as I am adding a phone number field and need to require that the visitor complete that field - if not get a message such as when the email address fails verification. (ie "Phone number is required") And as a second thought regarding the email - is there anyway to require the email be entered a second time and have it verify against the first entry? Appreciate any input Sue Link to comment Share on other sites More sharing options...
modem2.0 Posted February 26, 2010 Share Posted February 26, 2010 Hi, I have a strange behavior in the contact us email. PHP is eating all line breaks the customer enters in the form. For example, the user writes: Hello I´m interesting in buying product xpto, but I have some questions regarding bla, bla, bla Kind regards, Customer and I receive: HelloI´m interesting in buying product xpto, but I have some questions regarding bla, bla, blaKind regards,Customer It is very difficult to read the received email, specially from people that only writes in CAPITAL LETTERS and don't use any punctuation. I'm wondering if someone knows where this issue might be coming from, and if there is a fix that does not compromise security. I made a search in the forum and in google and found nothing interesting. I'm using the default OSC contact us file, just with some modifications in HTML to provide more info to the customer, but I also tried the Super Contact Us contribution with the same result. I'm also wondering if this is not happening to anyone else. Regards, Ideas anyone?? Link to comment Share on other sites More sharing options...
webart Posted March 1, 2010 Share Posted March 1, 2010 Hello, I am having the Contact Us problems and inserted the code in post number 2. Still doesn't work. Before doing that I contacted my host and they looked into the matter and here's there response to me: My settings are: E-Mail Transport Method sendmail E-Mail Linefeeds LF Use MIME HTML When Sending Emails false Verify E-Mail Addresses Through DNS false Send E-Mails true Thanks in advance for any ideas on this. I'm having the same problem, the Contact Us form is not working, however every other aspect of e-mail is working such as customer orders etc. I am friendly with my ISP, so if you can tell me what he should do, I'll tell him. For example if most systems don't permit a sender to be different e-mail addresses, can he use a wildcard on the server? Would this become a security issue? Can anyone add any more recent advice regarding this issue, I haven't touched my Contact Us file code since it was originally downloaded and installed, which seems crazy to me that it doesn't work, especially seeing all other aspects of the e-mail are working. Any tips, I'm prepared to crawl over razor blades and through barbed wire to get this working B) Regards Ron Link to comment Share on other sites More sharing options...
♥multimixer Posted March 1, 2010 Author Share Posted March 1, 2010 I'm having the same problem, the Contact Us form is not working, however every other aspect of e-mail is working such as customer orders etc. I am friendly with my ISP, so if you can tell me what he should do, I'll tell him. Maybe you try replacing the sender to be the store owner (like described in post#2) and make sure the store owner email belongs to your domain. Does it work then? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
webart Posted March 2, 2010 Share Posted March 2, 2010 Maybe you try replacing the sender to be the store owner (like described in post#2) and make sure the store owner email belongs to your domain. Does it work then? Hi George, I did the post#2 and it didn't make any difference, and yes the store owner is in the domain. I sent a copy of your link to the server operator, he is a good bloke and perhaps when he reads and sees what you have said in that previous reply, it might help him by jogging his memory in some respect. Unless you can think of anything else that I can do programatically, it would appear that it might be a server issue. I tried all the settings possible, smtp & sendmail and so on. Have you had any experiences where the post#2 code did not resolve the Contact Us form working and then suggested something additional? It is a little strange in that orders work, so does Guest can tell a friend. This is the area where it's hard to get your head around, the e-mail works thus certain parts of the server obviously are working, but just not the Contact Us form, which once again points to a script issue. Just for the record, i'll post my full code for the Contact Us page, after I finally resolve the issue I'll come back and delte it out because I don't really want unnecessarily long posts. I'm doing this also to have you check the line endings, I'm starting to realise that php is very particular about what is on each line: <?php /* $Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US); $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) { $name = tep_db_prepare_input($HTTP_POST_VARS['name']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); // BOF multimixer// //define variable $email_body// $email_body = $enquiry . "\r\n" . $name . "\r\n" . $email_address; // if you want to add more fields do so by adding this line [ ."\r\n" . ] between the fields you wish to display and order them acourdingly// //define variable $from_email. Set to Store owner email address as defined in Admin panel// $from_email = (STORE_OWNER_EMAIL_ADDRESS); //EOF multimixer // //BOF Multimixer// // $enquiry replaced by $email_body Includes $email_body to message instead of $enquiry. $email_address replaced by $from_email Email is getting send from $from-email instead of $email_address// if (tep_validate_email($email_address)) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $email_body, $name, $from_email); //EOF multimixer// tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success')); } else { $error = true; $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="col_left"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </td> <!-- body_text //--> <td width="100%" class="col_center"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr><td> <?php tep_draw_heading_top();?> <?php new contentBoxHeading_ProdNew($info_box_contents);?> <?php tep_draw_heading_top_1();?> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($messageStack->size('contact') > 0) { ?> <tr> <td><?php echo $messageStack->output('contact'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?> <tr> <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php echo tep_draw_infoBox_top();?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table> <?php echo tep_draw_infoBox_bottom();?> </td> </tr> </table> <?php } else { ?> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td> <?php echo tep_draw_infoBox_top();?> <table border="0" width="100%" cellspacing="5" cellpadding="2"> <tr> <td class="main"><?php echo ENTRY_NAME; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('name'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_EMAIL; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_input_field('email'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_ENQUIRY; ?></td> </tr> <tr> <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right" class="bg_input"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr> </table> <?php echo tep_draw_infoBox_bottom();?> </td> </tr> </table> <?php } ?> <?php tep_draw_heading_bottom_1();?> <?php tep_draw_heading_bottom();?> </td></tr> </table> </form></td> <!-- body_text_eof //--> <td class="col_right"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--></body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Regards Ron Link to comment Share on other sites More sharing options...
♥multimixer Posted March 2, 2010 Author Share Posted March 2, 2010 Hi George, I did the post#2 and it didn't make any difference, and yes the store owner is in the domain. [...] It is a little strange in that orders work, so does Guest can tell a friend. Post #2 does nothing more that to replace the sender of the email to be the store owner instead of the customer. This is for cases/hosts (like yahoo) where only the domain owner can send emails via php scripts. Doing this changes you send an email to your self with the contact us The order confirmation mail is send by the store owner, so it has not this sort of problems If you say that tell a friend works (where none of the emails belongs to the domain) then the changes of post #2 are useless, but the issue becomes even more strange. Lets wait what the host say My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
webart Posted March 3, 2010 Share Posted March 3, 2010 Post #2 does nothing more that to replace the sender of the email to be the store owner instead of the customer. This is for cases/hosts (like yahoo) where only the domain owner can send emails via php scripts. Doing this changes you send an email to your self with the contact us The order confirmation mail is send by the store owner, so it has not this sort of problems If you say that tell a friend works (where none of the emails belongs to the domain) then the changes of post #2 are useless, but the issue becomes even more strange. Lets wait what the host say Agreed George, the host can't look until the weekend and it is Wednesday evening here at the moment, so I just have to wait a couple of days. Would you suggest I put the code back to it's original or leave it the way it is (above)? Regards Ron Link to comment Share on other sites More sharing options...
Guest Posted March 3, 2010 Share Posted March 3, 2010 Hello, I followed the directions for adding extra input fields to the contact form, however the extra fields are not being sent through with the email. The only thing I receive in the email is the customer's message, but not any of the data from the extra fields I have added. Any suggestions? Thanks! :) Link to comment Share on other sites More sharing options...
Guest Posted March 3, 2010 Share Posted March 3, 2010 Fixed it, sorry! :) Link to comment Share on other sites More sharing options...
webart Posted March 6, 2010 Share Posted March 6, 2010 Agreed George, the host can't look until the weekend and it is Wednesday evening here at the moment, so I just have to wait a couple of days. Would you suggest I put the code back to it's original or leave it the way it is (above)? Hi George, the system operator fixed the issue of the Contact Us page at the server end and it works, as does the Guest tell a friend, and also the Send Email in the tools section of the administration section, however I am not getting a store owners copy of email when someone buys a product. I've gone over the Checkout_Process.php file and I don't think the issue is there. I did amend a few files to get the 'Call for Price' to work, could this have had an impact on sending copies of purchase orders to the Store Owner? Where should I look to fix this one last remaining problem? Regards Ron Link to comment Share on other sites More sharing options...
♥multimixer Posted March 6, 2010 Author Share Posted March 6, 2010 Hi George, the system operator fixed the issue of the Contact Us page at the server end and it works, as does the Guest tell a friend, and also the Send Email in the tools section of the administration section, however I am not getting a store owners copy of email when someone buys a product. I've gone over the Checkout_Process.php file and I don't think the issue is there. I did amend a few files to get the 'Call for Price' to work, could this have had an impact on sending copies of purchase orders to the Store Owner? Where should I look to fix this one last remaining problem? Well, first, glad that contact us work now. The order confirmation mail, customers and owners copy, is done in checkout_process.php. So, looking must start from there. Post the relevant code of the file (lets start with the email ....). I'm sure that you have a email set for "send extra orders to" in your admin panel, right? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
webart Posted March 6, 2010 Share Posted March 6, 2010 Well, first, glad that contact us work now. The order confirmation mail, customers and owners copy, is done in checkout_process.php. So, looking must start from there. Post the relevant code of the file (lets start with the email ....). I'm sure that you have a email set for "send extra orders to" in your admin panel, right? Yes George, I have "send extra orders to" working correctly, it is just that I am not getting the store owner copy of the e-mail, here is my code for the checkout_process.php below, I think in my zeal to learn this language I have actually mixed different versions of some files, it wouldn't surprize me Anyway here is the code: <?php /* $Id: checkout_process.php 1750 2007-12-21 05:20:28Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2007 osCommerce Released under the GNU General Public License */ include('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping') || !tep_session_is_registered('sendto')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($cart->cartID) && tep_session_is_registered('cartID')) { if ($cart->cartID != $cartID) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS); // load selected payment module require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment($payment); // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); require(DIR_WS_CLASSES . 'order.php'); $order = new order; // Stock Check $any_out_of_stock = false; if (STOCK_CHECK == 'true') { for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) { $any_out_of_stock = true; } } // Out of Stock if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } } $payment_modules->update_status(); if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); } require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); // load the before_process function from the payment modules $payment_modules->before_process(); $sql_data_array = array('customers_id' => $customer_id, 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_company' => $order->customer['company'], 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], 'customers_postcode' => $order->customer['postcode'], 'customers_state' => $order->customer['state'], 'customers_country' => $order->customer['country']['title'], 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => trim($order->delivery['firstname'] . ' ' . $order->delivery['lastname']), 'delivery_company' => $order->delivery['company'], 'delivery_street_address' => $order->delivery['street_address'], 'delivery_suburb' => $order->delivery['suburb'], 'delivery_city' => $order->delivery['city'], 'delivery_postcode' => $order->delivery['postcode'], 'delivery_state' => $order->delivery['state'], 'delivery_country' => $order->delivery['country']['title'], 'delivery_address_format_id' => $order->delivery['format_id'], 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'], 'billing_suburb' => $order->billing['suburb'], 'billing_city' => $order->billing['city'], 'billing_postcode' => $order->billing['postcode'], 'billing_state' => $order->billing['state'], 'billing_country' => $order->billing['country']['title'], 'billing_address_format_id' => $order->billing['format_id'], 'payment_method' => $order->info['payment_method'], 'cc_type' => $order->info['cc_type'], 'cc_owner' => $order->info['cc_owner'], 'cc_number' => $order->info['cc_number'], 'cc_expires' => $order->info['cc_expires'], 'date_purchased' => 'now()', 'orders_status' => $order->info['order_status'], 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value']); tep_db_perform(TABLE_ORDERS, $sql_data_array); $insert_id = tep_db_insert_id(); for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => $insert_id, 'title' => $order_totals[$i]['title'], 'text' => $order_totals[$i]['text'], 'value' => $order_totals[$i]['value'], 'class' => $order_totals[$i]['code'], 'sort_order' => $order_totals[$i]['sort_order']); tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); } $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0'; $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => $order->info['order_status'], 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); // initialized for the email confirmation $products_ordered = ''; $subtotal = 0; $total_tax = 0; for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = $order->products[$i]['attributes']; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } } // Update products_ordered (for bestsellers list) tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); $sql_data_array = array('orders_id' => $insert_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']); tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); $order_products_id = tep_db_insert_id(); //------insert customer choosen option to order-------- $attributes_exist = '0'; $products_ordered_attributes = ''; if (isset($order->products[$i]['attributes'])) { $attributes_exist = '1'; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { if (DOWNLOAD_ENABLED == 'true') { $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad on pa.products_attributes_id=pad.products_attributes_id where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"; $attributes = tep_db_query($attributes_query); } else { $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); } $attributes_values = tep_db_fetch_array($attributes); $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']); tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'orders_products_filename' => $attributes_values['products_attributes_filename'], 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 'download_count' => $attributes_values['products_attributes_maxcount']); tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); } $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; } } //------insert customer choosen option eof ---- $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; $total_cost += $total_products_price; $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; } // lets start with the email confirmation //BOF Multimixer 21.6.09 //$email_order = STORE_NAME . "\n\n" . $email_order .= EMAIL_TEXT_CUSTOMER_GREETING . ' ' . $order->customer['firstname'] . ' ' . $order->customer['lastname'] . "\n\n". EMAIL_TEXT_GREETING . "\n" . //EOF Multimixer 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"; $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"; } //BOF Multimixer 19.6.09 $email_order .= EMAIL_TEXT_CUSTOMER_TELEPHONE . ' ' . $order->customer['telephone'] . "\n"; $email_order .= EMAIL_TEXT_CUSTOMER_MAIL . ' ' . $order->customer['email_address']. "\n\n"; // EOF Multimixer $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n"; //BOF Multimixer 19.6.09 $email_order .= EMAIL_TEXT_CUSTOMER_TELEPHONE . ' ' . $order->customer['telephone'] . "\n"; $email_order .= EMAIL_TEXT_CUSTOMER_MAIL . ' ' . $order->customer['email_address']. "\n\n"; // EOF Multimixer 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 ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } //BOF Multimixer 19.6.09 if ($order->info['comments']) { $email_order .= EMAIL_TEXT_CUSTOMER_COMMENT . "\n". EMAIL_SEPARATOR . "\n". tep_db_output($order->info['comments']) . "\n\n"; } $email_order .= EMAIL_TEXT_SIGNATURE . "\n"; //EOF Multimixer tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // BOF Multimixer 25.6.2009. send emails to other people $email_store .= EMAIL_TEXT_STORE_INTRO . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_STORE_CUSTOMER . ' ' . $order->customer['firstname'] . ' ' . $order->customer['lastname'] . "\n". EMAIL_TEXT_CUSTOMER_ID . ' ' . $customer_id . "\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"; $email_store .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_store .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } if ($order->content_type != 'virtual') { $email_store .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } $email_store .= EMAIL_TEXT_CUSTOMER_TELEPHONE . ' ' . $order->customer['telephone'] . "\n"; $email_store .= EMAIL_TEXT_CUSTOMER_MAIL . ' ' . $order->customer['email_address']. "\n\n"; $email_store .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n"; $email_store .= EMAIL_TEXT_CUSTOMER_TELEPHONE . ' ' . $order->customer['telephone'] . "\n"; $email_store .= EMAIL_TEXT_CUSTOMER_MAIL . ' ' . $order->customer['email_address']. "\n\n"; if (is_object($$payment)) { $email_store .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_store .= $order->info['payment_method'] . "\n\n"; if ($payment_class->email_footer) { $email_store .= $payment_class->email_footer . "\n\n"; } } if ($order->info['comments']) { $email_store .= EMAIL_TEXT_CUSTOMERS_COMMENT . "\n". EMAIL_SEPARATOR . "\n". tep_db_output($order->info['comments']) . "\n\n"; } if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_STORE_SUBJECT, $email_store, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } //EOF // load the after_process function from the payment modules $payment_modules->after_process(); $cart->reset(true); // unregister session variables used during checkout tep_session_unregister('sendto'); tep_session_unregister('billto'); tep_session_unregister('shipping'); tep_session_unregister('payment'); tep_session_unregister('comments'); tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Regards Ron Link to comment Share on other sites More sharing options...
♥multimixer Posted March 6, 2010 Author Share Posted March 6, 2010 Yes George, I have "send extra orders to" working correctly, it is just that I am not getting the store owner copy of the e-mail What exactly is not working? The store owner mail is send via the "send extra orders" setting in admin. Don't you get any notification if a customer order or don't you get the owners version of the mail? PS Can you please post the code using the code tags ,(look like this <> in the menu reply bar, so it's easy to read and to copy? Would be a great help My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
webart Posted March 6, 2010 Share Posted March 6, 2010 What exactly is not working? The store owner mail is send via the "send extra orders" setting in admin. Don't you get any notification if a customer order or don't you get the owners version of the mail? PS Can you please post the code using the code tags ,(look like this <> in the menu reply bar, so it's easy to read and to copy? Would be a great help Hello George, if a customer buys a product, he gets his e-mail correctly, plus I can get an e-mail sent to me using say a spare Hotmail account that I have, but I cannot get a notification via e-mail as the Store Owner (using the correct domain e-mail address). Also, now I see the <> facility, sorry I never knew about it, in future I will put all my code snippets inside like this: osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com There are so many wonderful features of this forum, thank you Regards Ron Link to comment Share on other sites More sharing options...
♥multimixer Posted March 6, 2010 Author Share Posted March 6, 2010 Hello George, if a customer buys a product, he gets his e-mail correctly, plus I can get an e-mail sent to me using say a spare Hotmail account that I have, but I cannot get a notification via e-mail as the Store Owner (using the correct domain e-mail address). So, let me understand: You receive, as a store owner, the new order email to a hotmail account that you have set in "send extra order emails" but you can not get the email to your store owner mail address? The new order emails are send ONLY to addresses set in the "send extra mail" field, they are not send to the store owner automatically. So you need to enter the store owner mail address into this field one more time By the way, I'm just thinking, that this could be changed so that the store owner receives ALWAYS an email and the "extra mails" keep their meaning of "extra" To get this do as follows in file checkout_process.php find if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_STORE_SUBJECT, $email_store, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); } add just before // send email to store owner always multimixer 6 3 2010 tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_STORE_SUBJECT, $email_store, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); If you have the option installed to receive a mail when a person register then in file create_account.php find if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_OWNER_SUBJECT, $owners_text, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); } add just before // send email to store owner always multimixer 6 3 2010 tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_OWNER_SUBJECT, $owners_text, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); I hope that I have no mistake anywhere in the hurry. Can you test this and report it is working? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.