MotoDelta,
Ok here's what I did. It works for me.
Create a file in your admin folder called "multisite_order_settings.php". You have to change YOUR_DOMAIN.COM to your domain name of course. So for "mystore.example.com" you would just use example.com. If you look through this the idea is that it should accomodate one domain with a bunch of subdomains *.example.com and if, like me, you have some FQDN's that you use with Multisite ex. www.mystore.com
PHP Code:
<?php
if (isset($_GET['oID'])) {
$oID = zen_db_prepare_input(trim($_GET['oID']));
$domain_name = "YOUR_DOMAIN.COM";
$orders = $db->Execute("select order_site from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
if ($orders->RecordCount() > 0)
{
$order_template = $orders->fields['order_site'];
$config_folder = DIR_FS_CATALOG . DIR_WS_INCLUDES . 'config_sites/';
$subdomain = $order_template .".". $domain_name ."_config.php";
$dotcom = "www.". $order_template . ".com_config.php";
if (file_exists($config_folder . $subdomain))
{
include($config_folder . $subdomain);
$store_url = $order_template .".". $domain_name;
$store_name = $store_url;
}
else if (file_exists($config_folder . $dotcom))
{
include($config_folder . $dotcom);
$store_url = "www.". $order_template .".com";
$store_name = $store_url;
}
else
{
echo "Error pulling site config file. Is the config file using a non-standard domain name or filename? Can't find:<br>";
echo $config_folder . $subdomain . "<br>";
echo $config_folder . $dotcom. "<br>";
}
$invoice_link = "https://". $store_url . DIR_WS_HTTPS_CATALOG . "index.php?main_page=account_history_info&order_id=". (int)$oID ."\n\n";
$store_image = "http://". $store_url . DIR_WS_HTTPS_CATALOG . DIR_WS_INCLUDES . "templates/". $order_template . "/images/email_header.gif";
$email_from_name = EMAIL_FROM;
$email_from_name = $store_url;
}
}
?>
I'm kinda going for a config_sites type config file here, but of course it's completely based on the order id instead of the domain your visiting. As you can see there are some variables being set here that you can control. Set them to whatever applies for you. For example the email_header.gif image is a naming convention I use, so you may just use logo.gif.
Then include that file from admin/orders.php. Make sure it's after the other require/include statements
PHP Code:
require("multisite_order_settings.php");
finally look for the email code in orders.php starting with this:
PHP Code:
//send emails
$message = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" .
etc etc...
replace it with this:
PHP Code:
//send emails
$message = $store_name . "\n" . EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . $invoice_link . "\n\n" .
EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
strip_tags($notify_comments) .
EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) .
EMAIL_TEXT_STATUS_PLEASE_REPLY;
$html_msg['EMAIL_CUSTOMERS_NAME'] = $check_status->fields['customers_name'];
$html_msg['EMAIL_STORE_NAME'] = $store_name;
$html_msg['EMAIL_HEADER_IMAGE'] = $store_image;
$html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID;
$html_msg['EMAIL_TEXT_INVOICE_URL'] = '<a href="' . $invoice_link .'">'.str_replace(':','',EMAIL_TEXT_INVOICE_URL).'</a>';
$html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']);
$html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
$html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\n','', EMAIL_TEXT_STATUS_UPDATED);
$html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\n','', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ));
$html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
$html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\n','', EMAIL_TEXT_STATUS_PLEASE_REPLY);
$html_msg['EMAIL_FOOTER_COPYRIGHT'] = 'Copyright (c) ' . date('Y') . ' <a href="http://'. $store_url .'" target="_blank">'. $store_url .'</a>.';
$customer_notified = '0';
if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) {
zen_mail($check_status->fields['customers_name'], $check_status->fields['customers_email_address'], EMAIL_TEXT_SUBJECT . ' #' . $oID, $message, $email_from_name, $email_from, $html_msg, 'order_status');
Let me know..
Bookmarks