This is opencart 1.5.5.1.1 - Have this errors:
PHP Notice: Undefined index: date_added in /home/u546774105/public_html/projects/all-converse/catalog/view/theme/theme1/template/product/category.tpl on line 88
PHP Notice: Undefined offset: 1 in catalog/view/theme/theme1/template/product/category.tpl on line 6
PHP Notice: Undefined offset: 2 in catalog/view/theme/theme1/template/product/category.tpl on line 6
PHP Warning: mktime() expects parameter 6 to be long, string given in catalog/view/theme/theme1/template/product/category.tpl on line 6
This is line 1-8
<?php
$latest_products_days = 7;
function showNew($date, $latest_products_days) {
$arr = explode(" ", $date);
$arrdate = explode("-", $arr[0]);
$timestamp = (mktime(0, 0, 0, $arrdate[1], $arrdate[2], $arrdate[0]));
$difference = floor((time() - $timestamp)/86400);
if ($difference < $latest_products_days) return true; else return false;
}
?>
This is line 88
<?php
if (showNew($product['date_added'], $latest_products_days)) echo '<div class="new"> </div>'; ?><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
<?php } ?>
i solved it: variable $product['date_added'] wasnot undefined in catalog/controller/category.php I add 'date_added' => $result['date_added'],
to this array $this->data['products'][] = array(