Jump to content

Possible to add "Source" (e.g. Google) in the order email?


Recommended Posts

Add something like the following to the hookNewOrder function in modules/mailalerts/mailalerts.php:

$sources = ConnectionsSource::getOrderSources($order->id);
$order_sources = '';

if (sizeof($sources))
{
   foreach ($sources as $source)
       $order_sources .= Tools::displayDate($source['date_add'], intval($cookie->id_lang), true).'

'.$this->l('From:').' '.preg_replace('/^www./', '', parse_url($source['http_referer'], PHP_URL_HOST)).'

'.$this->l('To:').' '.$source['request_uri'].'

               '.($source['keywords'] ? ''.$this->l('Keywords:').' '.$source['keywords'].'
' : '').'


';
}



Put it after the following line:

$order = $params['order'];



Then add the following to the $templateVars array:

'{order_sources}' => $order_sources,

Link to comment
Share on other sites

  • 3 years later...

hello, i know this is an old tread post, but i really hope one of you can explain me about what is this data mean 

Fromgoogle.co.uk

To www.stdtestcanada.com/~stdt0283/stdtestcanada.com/home/8-chlamydia-test.html
Keywords home chlamydia test kit canada

 

i know the customer came from google.co.uk with keyword "home chlamydia test kit canada", i assume my site is ranked well by google.co.uk with that keyword, but its not. The more important thing that i don't understand, what the URL mean is?

i don't have that url on my site

 

Please give me a clue or the exact answer if you have it

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...