Question

I have add below code in core file( catalog\controller\product\category.php ) for Refine categories images. So, It is working fine.

But, when, this same code add via vqmod (without change core file). So, It is working fine. But, if, not available Refine categories in categories page.So, Get error ( Notice: Undefined variable:.... )

ADDED code :

$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));

How to fix it?

Thanks.

Was it helpful?

Solution

Its quite simple actually change the code you add to:

    if(isset($the_varialbe_that_is_undefined)){
    //code you want to exexute
    $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
    //end   
 }

It depends on what you want it to do, so you need to check the right variable,and afterwards call the code so you do not get these kind of errors.

Same logic is applied in every case that get this kind of error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top