I see from another post off of this thread that someone indicated that "model_checkout_order" doesn't seem to have a "getOrderProducts" method anymore, and the shipping total was missing as well... they went on to say they used the following instead on success.php:
$this->load->model('account/order');
$this->data['orderDetails'] = $this->model_account_order->getOrder($this->session->data['order_id']);
$this->data['orderDetails']['shipping_total'] = $this->session->data['shipping_method']['cost'];
$this->data['orderProducts'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);
but I have just tried this with still no luck.
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
http://forum.opencart.com/viewtopic.php ... ilit=ecomm
Keep me posted on anything you come up with
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
Code: Select all
$this->load->model('account/order');
$this->data['orderDetails'] = $this->model_account_order->getOrder($this->session->data['order_id']);
$this->data['orderDetails']['shipping_total'] = $this->session->data['shipping_method']['cost'];
$this->data['orderProducts'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);
Incidentally, I am giving this extension a go -at this point I am over my deadline and need a solution quick. That extension, Google Analytics Pro adds ecommerce tracking and (after 5-10 minutes looking at the code) it looks like a fairly elegant solution and easy to install. The extension is mentioned on the forum, too.
Will keep you posted
Gary
The extension says compatible with 1.4.9.5
That may play havoc with me being on 1.4.7.
But let me know how it goes for sure.
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
You might be in luck -the author has included respective archives for different Opencart versions -see attached pic for info. There isn't a a version for 1.4.7 specifically but perhaps it's worth shotting the author a PM or enquiry to see if one will work for you?
Gary
Attachments
Google Analytics Pro - gapro.png (7.43 KiB) Viewed 12781 times
Hi again,stonehinged wrote:Second post it mentions ...In catalog/controller/checkout/success.php...
Yeah I know the code is supposed to go in /controller/checkout/success.php -Justinv appended this to the first post, but were you suggesting that it needs to go elsewhere?
Gaz
/controller/checkout/success.php was where I understand the code goes... didn't mean to create any confusion there.
Great idea on reaching out to the extension developer. Will certainly ask the question. Thanks.
I'm hopeful once Google Ecom tracking can be achieved, whatever variable is used for OrderTotal will work for my Google AdWords (PPC) tracking as well!
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
I'm having some odd findings with this.
i have 3 sites that i look after. I have followed the instructions exactly all three times. It works for 1, but not the other two.
The working site, and one of the others are pretty much identical clones of each other, and i've compared the files which are identical (apart from the obvious such as the unique google analytics reference etc)
Both have been set up the same in analytics too.
any ideas why one might work but the other two don't?
cheers!
personalised car signs
personalised bedroom door signs
personalised gifts for kids
What versions are your carts? How do you know it's not working (maybe a dumb question but could be important)?
Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
I've tested the site by using "cash on delivery" and putting through some false transactions. All of the transactions from one site work, none of the transactions from the other site do.
I've ensured i'm looking at the correct date range in google analytics (as it normally defaults to not include todays traffic)
all sites are 1.4.8b
The working site is a clone of a non working site - ie the non working site was my first online shop, i then expanded my business, and rather than rebuild a new site, i simply copied all the files and the database to another server, then just edited the products i used, so any modifications i've made are apparent in both sites.
Any thoughts on how i can troubleshoot this? Could there be any other factors that would prevent this from working (ie modifications to the site elsewhere, or other settings within google analytics?)
Cheers
working site : http://www.personalisedrewardcharts.co.uk
cloned from http://www.personalisedcarsigns.co.uk - not working
other non working site http://www.sheetplastics.co.uk
personalised car signs
personalised bedroom door signs
personalised gifts for kids
Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
all sites are now working and tracking orders, so if anyone doesn't succeed first time, give it a few days then try again. It seems to have taken about 48 hours to start working, but all looks fine now.
Thanks!
personalised car signs
personalised bedroom door signs
personalised gifts for kids
Hope that's helpful to someone - I note there is also a vQmod available on page 1 of this topic, also helpful.
Thanks
Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
According to Google the new async tracker must be just before the </head> tag, with this module it is positioned somewhere in the body depending on when the module is installed, and I can't control where the module is positioned. Could this be the reason it is not working correctly?
I wrote Justin on his site but no response yet, any help would be greatly appreciated.
-Tom
Change the positioning of the tracker to just before the </head> tag as suggested by google.
Add this to /catalog/controller/common/header.php
Code: Select all
$headtag_data = array();
$sorting_order = array();
$headtag_results = $this->model_checkout_extension->getExtensions( 'module' );
foreach( $headtag_results as $headtag_result ) {
if( $this->config->get( $headtag_result['key'] . '_status' )
&& ( $this->config->get($headtag_result['key'] . '_position' ) == 'headtag' ) ) {
$headtag_data[] = array(
'code' => $headtag_result['key'],
'sort_order' => $this->config->get( $headtag_result['key'] . '_sort_order' )
);
$this->children[] = 'module/' . $headtag_result['key'];
}
}
foreach( $headtag_data as $key => $value ) {
$sorting_order[$key] = $value['sort_order'];
}
array_multisort( $sorting_order, SORT_ASC, $headtag_data );
$this->data['headtags'] = $headtag_data;
// end getting <head> modules
Code: Select all
<input type="hidden" name="tracking_position" value="left">
Code: Select all
<input type="hidden" name="tracking_position" value="headtag">
Code: Select all
$this->data['text_headtag'] = $this->language->get('text_headtag');
and the corresponding language file admin/language/yourlanguage/module/tracking.php
Code: Select all
$_['text_headtag'] = 'head tag';
and then added in /view/theme/mytheme/template/module/tracking.tpl as it was missing from the javascript
Code: Select all
_gaq.push(['_trackPageview']);
A happy OpenCart developer from Brighton.
Thanks everyone for your help with this!
Edit: Removed the attachment as it has an error in it which prevented it from working sometimes. Get the corrected code from this post.
A happy OpenCart developer from Brighton.
Users browsing this forum: No registered users and 82 guests