php - Opencart search and special pages image bug -


there error in product search , special offers page. when run product search , results (or check special offers page). put mouse on product image , get:

"notice: undefined index: image_add in /home/database/public_html/catalog/view/theme/marcus/template/product/search.tpl on line 105notice: undefined index: image_add in /home/database/public_html/catalog/view/theme/marcus/template/product/search.tpl on line 115"... (also add pic of problem) 

code of part undefined index is:

<?php                     if($product['image_add'] != ''){                         $file_headers = @get_headers($product['image_add']);                         if($file_headers[0] == 'http/1.1 404 not found') {                             $exists = false;                         }                         else {                             $exists = true;                         }                     }                      if($product['image_add'] != '' && $exists){ ?>  

wierd part bout problem same parts of code used in other pages, in 2 pages (special offers , search result page) problem exist.

my oc version 1.5.6.4 , theme link:

i'm not programmer, know little bit bout coding (apperantly not enough fix these kinda issues). if possible (and if know how fix this) writte answer simple possible.

p.s.

i contact theme creatore supp till today no answer him.

regards,

since index in question (apparently) not exist, php going throw error when check it's value. avoid error can add logic make sure exists:

<?php     if(isset($product['image_add']) && $product['image_add'] != ''){         $file_headers = @get_headers($product['image_add']);         if($file_headers[0] == 'http/1.1 404 not found') {             $exists = false;         } else {             $exists = true;         }     }     if(isset($product['image_add']) && $product['image_add'] != '' && $exists){ ?>  

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -