Hi,
I would like vendors to receive a custom message whenever they get an order processed. Currently, they get copied on the same email sent to customers. Can this be easily done with a few lines of codes or this would be a candidate for a custom addon?
Thanks!
Multivendor 4.3.9
Hi,
You can add some custom message by adding some lines of code in some files.
Please open file named
app/functions/fn.cart.php
There is function name :
fn_order_notification(&$order_info, $edp_data = array(), $force_notification = array())
This function contains the lines of code from where vendor got notification related to order. The lines of code is:
if ($notify_vendor == true) {
if (fn_allowed_for('MULTIVENDOR') && !empty($order_info['company_id'])) {
$company_lang_code = fn_get_company_language($order_info['company_id']);
// Translate descriptions to admin language
fn_translate_products($order_info['products'], '', $company_lang_code, true);
Mailer::sendMail(array(
'to' => 'company_orders_department',
'from' => 'default_company_orders_department',
'reply_to' => $order_info['email'],
'data' => array(
'order_info' => $order_info,
'shipments' => $shipments,
'use_shipments' => $use_shipments,
'order_status' => fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], $company_lang_code),
'payment_method' => fn_get_payment_data($payment_id, $order_info['order_id'], $company_lang_code),
'status_settings' => $status_settings,
'profile_fields' => fn_get_profile_fields('I', '', $company_lang_code),
'secondary_currency' => $secondary_currency
),
'tpl' => 'orders/order_notification.tpl',
'company_id' => $order_info['company_id'],
), 'A', $company_lang_code);
}
}
You can add custom data here accordingly.
For example : if you want to add a index "custom_message" which contains the custom data after a index "'secondary_currency' => $secondary_currency" in above lines of code.
'custom_message' =>'custom text',
When you add custom code after that you need to add code according in tpl file also.
Go to design/backend/mail/templates/orders :
At this point you need to think logically. There are two tpl files :
1) invoice.tpl
2) order_notification.tpl
You need to add "custom_message" index data in the above tpl file also as per requirements.
Hope above steps help you.
Thank you