Post by htwp » Fri Mar 31, 2017 10:16 pm

Hi to all,

as i know when a notice like this ->? PHP Notice: Undefined variable happens in a .tpl file it means that is not defined(the variable) in controller file.... but what does it mean when this notice happens inside a controller file? the full notice is:

PHP Notice: Undefined variable: the_category_customer_groups in httpdocs/vqmod/vqcache/vq2-system_modification_admin_controller_catalog_category.php on line 684 the line is :

'category_customer_groups' => $the_category_customer_groups,
how to resolve it? my main purpose first is to understand what is the problem here and secondly to fix it.

If you have any idea i would be grateful to hear it.

thank you in advance.

Active Member

Posts

Joined
Sun Oct 14, 2012 1:29 am

Post by angela » Sat Apr 01, 2017 1:22 am

$the_category_customer_groups is blank or null. Whatever variable is passing data to it, isn't returning anything.

So find the original reference to $the_category_customer_groups - are any of the surrounding variables like $the_category_customer_groups['something'] ? If so, it's missing its array.

Or is there something like:

Code: Select all

$the_category_customer_groups = $query['something']
anywhere?

If so, 'something' is passing null or blank, or $query doesn't exist.

User avatar
New member

Posts

Joined
Fri Dec 02, 2016 2:14 am

Post by htwp » Sat Apr 01, 2017 3:31 am

inside xml file there are only two $the_category_customer_groups

<operation>
<search position="before"><![CDATA[
$data['categories'][] = array(
]]></search>
<add><![CDATA[
if ($this->config->get('config_update_category_customer_groups_in_category_list') == 1){
$this->model_catalog_category->updateAllCategoriesToDefaultCustomerGroups();
}

$this->load->model('customer/customer_group');
$data['customer_groups'] = $this->model_customer_customer_group->getCustomerGroups();
$the_category_customer_groups = $this->model_catalog_category->getCategoryCustomerGroups($result['category_id']);
]]></add>
</operation>

<operation>
<search position="before"><![CDATA[
'category_id' => $result['category_id'],
]]></search>
<add><![CDATA[
'category_customer_groups' => $the_category_customer_groups,
]]></add>
</operation>

any idea? i am searching this many days now and i am at dead end with no any info in forum...so i appreciate your help

Active Member

Posts

Joined
Sun Oct 14, 2012 1:29 am

Post by angela » Sat Apr 01, 2017 7:23 am

Focus on this:

Code: Select all

$this->model_catalog_category->getCategoryCustomerGroups($result['category_id']);
Is this plugin supposed to append code that contains the getCategoryCustomerGroups() function?
I don't have that in my model.

If you can't find the getCategoryCustomerGroups() function in either your plugin or category model file, this is your culprit. It isn't being appended to where it needs to be in order for the vQmod to work.

User avatar
New member

Posts

Joined
Fri Dec 02, 2016 2:14 am

Post by htwp » Sat Apr 01, 2017 2:27 pm

You helped me very much... i will look at this
thank you !!!

Active Member

Posts

Joined
Sun Oct 14, 2012 1:29 am
Who is online

Users browsing this forum: No registered users and 18 guests