Dear All,
I created the google analytics account, and installed the google analytics in Opencart 2.2.0.0,
Pasted the code, after I click save there is an error:
"Notice: Undefined index: store_id in /home/mydomain/public_html/admin/controller/analytics/google_analytics.php on line 13Warning: Cannot modify header information - headers already sent by (output started at /home/mydomain/public_html/admin/controller/startup/error.php:34) in /home/mydomain/public_html/system/library/response.php on line 12"
anybody can help on this issue? Thanks.
I created the google analytics account, and installed the google analytics in Opencart 2.2.0.0,
Pasted the code, after I click save there is an error:
"Notice: Undefined index: store_id in /home/mydomain/public_html/admin/controller/analytics/google_analytics.php on line 13Warning: Cannot modify header information - headers already sent by (output started at /home/mydomain/public_html/admin/controller/startup/error.php:34) in /home/mydomain/public_html/system/library/response.php on line 12"
anybody can help on this issue? Thanks.
Since I do not see anywhere else on that file where the store_id is being used,
In admin/controller/analytics/google_analytics.php file,
find:
replace with:
This should resolved the problem.
In admin/controller/analytics/google_analytics.php file,
find:
Code: Select all
$this->model_setting_setting->editSetting('google_analytics', $this->request->post, $this->request->get['store_id']);
Code: Select all
$this->model_setting_setting->editSetting('google_analytics', $this->request->post);
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thanks a lot. Works perfectly for single store. 
See multi-store solution here: http://forum.opencart.com/viewtopic.php?f=191&t=160302

See multi-store solution here: http://forum.opencart.com/viewtopic.php?f=191&t=160302
Dum spiro spero.
tried both of the solutions but the Google Analytics cod is not visible on the website.
Nasir Khan Saikat
http://nasirkhn.com
Hello
Those codes that you enter is not in my google_analytics.php file?
In my google_analytics.php fil are only following code:
<?php
class ControllerAnalyticsGoogleAnalytics extends Controller {
public function index() {
return html_entity_decode($this->config->get('google_analytics_code'), ENT_QUOTES, 'UTF-8');
}
}
Why is it here?
Those codes that you enter is not in my google_analytics.php file?
In my google_analytics.php fil are only following code:
<?php
class ControllerAnalyticsGoogleAnalytics extends Controller {
public function index() {
return html_entity_decode($this->config->get('google_analytics_code'), ENT_QUOTES, 'UTF-8');
}
}
Why is it here?
Who is online
Users browsing this forum: No registered users and 12 guests