문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top