DJones Posted November 26, 2003 Posted November 26, 2003 I need some help. As most of us are, I'm trying to customize my install of OSC. Right now I am trying to personalize the order confirmation email sent to the customer. I was fiddling with the code on /catalog/checkout_process.php a couple of days ago and managed to get the customer [firstname] as the email greeting. I broke something altogether unrelated and had to install again. Dagnabbit, I can't seem to remember the right modification to get it to work again. As you might tell, I'm not too familar with php. I commented the STORE_NAME out, and somehow put in the info from the second bit of code (cust name) between the two "$email_order" tags. Can't seem to get the syntax right. Here's what I've got: ----------------------- // lets start with the email confirmation // $email_order = STORE_NAME . "\n" . $email_order .= "\r\nxxxxx thanks you for your order!\n\nYour purchase will be shipped within two days if it is in stock.\n\nIf you have ordered an item which is not is stock, it will be shipped as soon as it becomes available. We will send you a confirmation email when backordered items ship. Feel free to contact us at [email protected] \n\n" . // EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link ----------------------- 'customers_name' => $order->customer['firstname'] . ----------------------- Anybody got the answer? David Jones
wizardsandwars Posted November 26, 2003 Posted November 26, 2003 Can you be more specific on what you are trying to acomplish? Also, it appears that you have an extra '.' and a missing ';' at the end of the following... $email_order .= "\r\nxxxxx thanks you for your order!\n\nYour purchase will be shipped within two days if it is in stock.\n\nIf you have ordered an item which is not is stock, it will be shipped as soon as it becomes available. We will send you a confirmation email when backordered items ship. Feel free to contact us at [email protected] \n\n" . ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
DJones Posted November 26, 2003 Author Posted November 26, 2003 Can you be more specific on what you are trying to acomplish? Also, it appears that you have an extra '.' and a missing ';' at the end of the following... $email_order .= "\r\nxxxxx thanks you for your order!\n\nYour purchase will be shipped within two days if it is in stock.\n\nIf you have ordered an item which is not is stock, it will be shipped as soon as it becomes available. We will send you a confirmation email when backordered items ship. Feel free to contact us at [email protected] \n\n" . That part displays properly. What I am after is the top of the confirmation email to look like this: (where customer['firstname'] = Joe) ------------------------ Joe, My Company thanks you for your order! Your purchase will be shipped within two days if it is in stock etc... Order Details blah, blah, blah... ---------------------- I copied: 'customers_name' => $order->customer['firstname'] . from the top of the same page and inserted it, or rather part(s) of it, just above the "My Company" line. It took several tries but it was working as planned. The email began with the cutomers first name. I can't recall how I did it. The D in DJones stands for dunce...
wizardsandwars Posted November 26, 2003 Posted November 26, 2003 $email_order .= customer['firstname'] . "\r\nxxxxx thanks you for your order!\n\nYour purchase will be shipped within two days if it is in stock.\n\nIf you have ordered an item which is not is stock, it will be shipped as soon as it becomes available. We will send you a confirmation email when backordered items ship. Feel free to contact us at [email protected] \n\n" ; ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
DJones Posted November 27, 2003 Author Posted November 27, 2003 That bit of code did not work: "parse error line 223" This did it: ---------------- $email_order .= tep_db_output($order->customer['firstname']) . "\n\n"; // $email_order .= "\r\nXxxxxx thanks you for your order!\n\nYour purchase will be shipped within two days if it is in stock.\n\nIf you have ordered an item which is not is stock, it will be shipped as soon as it becomes available. We will send you a confirmation email when backordered items ship. Feel free to contact us at [email protected] \n\n" . -------------- Thanks for trying though. David
Guest Posted November 28, 2003 Posted November 28, 2003 hello DJones, i have tried what u entered but it does not work for me. i don't get what the XXXX are for. actually i understand what it is, but don't u have to add the code in that part? can u add your whole code so i can see what you did. or is that it? a bit confused. thanks.
DJones Posted November 28, 2003 Author Posted November 28, 2003 hello DJones, i have tried what u entered but it does not work for me. i don't get what the XXXX are for. actually i understand what it is, but don't u have to add the code in that part? can u add your whole code so i can see what you did. or is that it? a bit confused. thanks. In catalog/checkout_process.php, starting about line 222. (The xxxx stuff is just to mask the actual name and email, substitute your data. I put the first set of X's in parenthesis, leave the "\r\n, start your text right after it. Use \n\n to create a line feed.) // lets start with the email confirmation $email_order .= tep_db_output($order->customer['firstname']) . "\n\n"; // $email_order .= "\r\n(xxxxx) thanks you for your order!\n\nYour purchase will be shipped within two days if it is in stock.\n\nIf you have ordered an item which is not is stock, it will be shipped as soon as it becomes available. We will send you a confirmation email when backordered items ship. Feel free to contact us at [email protected] \n\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 .= $payment_class->title . "\n\n"; if ($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); David
Recommended Posts
Archived
This topic is now archived and is closed to further replies.