Hi. I have an opencart shop. It works great. However I'd like to add something to one of the files but I dont know where it is.
When a member places an order an email is sent to the admin account with the order number, product id etc. I would like to know where the config for this file is so I can add The username, email and a few other details of the person that placed the order so I can email them straight back from my phone.
Please can anybody help? I just need the path to the file. I can do the rest I think.
Thanks
When a member places an order an email is sent to the admin account with the order number, product id etc. I would like to know where the config for this file is so I can add The username, email and a few other details of the person that placed the order so I can email them straight back from my phone.
Please can anybody help? I just need the path to the file. I can do the rest I think.
Thanks
Hi Druid_McGrew
The email that gets sent to you is actually a copy of the one sent to the customer, so you'll need to add in a bit of logic to the code in order to send only to the admin. The file you're looking for is
/catalog/model/checkout/order.php, specifically the "confirm" method in there
Kind regards
Jay
The email that gets sent to you is actually a copy of the one sent to the customer, so you'll need to add in a bit of logic to the code in order to send only to the admin. The file you're looking for is
/catalog/model/checkout/order.php, specifically the "confirm" method in there
Kind regards
Jay
Ok I have found the code where an email is sent to the administrator with the order id and a few details. Its found round line 439 of order.php see below
Now I want to add just the forename, surname and email of the user that bought something. I changed to code to
Both the text_new_name and the text_new_email texts where added to the other order.php as needed and the row['firstname'] row['lastname'] row['email'] was taken from lines 91, 92, 95.
Now the problem is the name and email are still coming through blank. Obviously the row['firstname'] variable Im using is wrong. Can anyone help me with adding the correct variable to this mail query to get these details to show?
Thanks
Danny
Code: Select all
$text = $language->get('text_new_received') . "\n\n";
$text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
$text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "\n";
$text .= $language->get('text_new_order_status') . ' ' . $order_status . "\n\n";
$text .= $language->get('text_new_products') . "\n";
Code: Select all
// Text
$text = $language->get('text_new_received') . "\n\n";
$text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
$text = $language->get('text_new_name') . ' ' . $order_query->row['firstname'] . $order_query->row['lastname']. "\n";
$text = $language->get('text_new_email') . ' ' . $order_query->row['email'] . "\n";
$text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "\n";
$text .= $language->get('text_new_order_status') . ' ' . $order_status . "\n\n";
$text .= $language->get('text_new_products') . "\n";
foreach ($order_product_query->rows as $result) {
Now the problem is the name and email are still coming through blank. Obviously the row['firstname'] variable Im using is wrong. Can anyone help me with adding the correct variable to this mail query to get these details to show?
Thanks
Danny
Thanks Jay. Just awaiting an order to come in then ill know if its worked. thank you again for your help
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 98 guests