Post by distinct » Thu Feb 22, 2018 3:19 am

I am getting 2 errors from the same page PHP Notice: Undefined index: route in .../vqmod/vqcache/vq2-catalog_controller_common_header.php on line 19
and
PHP Notice: Undefined index: route in .../vqmod/vqcache/vq2-catalog_controller_common_header.php on line 23
These are referencing this code:
// start body_class code
$current_path = $this->request->get;
19> if (empty($current_path) || $current_path['route'] == 'common/home') {
$body_class = 'home';
}
else {
23> $body_class = explode('/', str_replace('product/', '', $current_path['route']));
unset($current_path['route']);
if (isset($current_path['_route_'])) {
$body_class = array_merge($body_class, explode('/', str_replace('-', '_', $current_path['_route_'])));
unset($current_path['_route_']);
}
foreach ($current_path as $key => $value) {
$body_class[] = $key . "_" . $value;
}
$body_class = 'page_' . implode(" page_", array_unique($body_class));
}
$body_class .= ' lang_' . $this->language->get('code');
$this->data['body_class'] = $body_class;

// end body_class code

to be sure it wasn't what I seen on another post I have checked my /template/common/header.tpl for this code:
<body class="<?php echo $body_class; ?>">

can someone please help. I just want to clear my error log
TIA

Newbie

Posts

Joined
Wed Aug 31, 2011 11:12 am

Post by IP_CAM » Thu Feb 22, 2018 4:07 am

Well, then just remove the VqMod, containing this line, since it is not part of the
default catalog/controller/common/header.php file in OC v.1.5.6.4:

Code: Select all

if (empty($current_path) || $current_path['route'] == 'common/home') {
Ernie

For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Thu Feb 22, 2018 6:35 am

Replace:

Code: Select all

if (empty($current_path) || $current_path['route'] == 'common/home') {
with:

Code: Select all

if ((empty($current_path)) || (!empty($current_path['route']) && $current_path['route'] == 'common/home')) {
Then, replace:

Code: Select all

$body_class = explode('/', str_replace('product/', '', $current_path['route']));
unset($current_path['route']);
with:

Code: Select all

if (!empty($current_path['route'])) {
$body_class = explode('/', str_replace('product/', '', $current_path['route']));
unset($current_path['route']);
}

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by distinct » Mon Feb 26, 2018 3:46 am

Awesome that looks like it fixed it

Newbie

Posts

Joined
Wed Aug 31, 2011 11:12 am
Who is online

Users browsing this forum: No registered users and 21 guests