I put the same in the 2.3.0.2 product.tpl file and I get the error: PHP Notice: Undefined property: Template\PHP::$load in /public_html/system/storage/modification/catalog/view/theme/default/template/product/product.tpl on line 48
Is loading a model in the tpl file no longer allowed?
BTW here is the code:
Code: Select all
<?php
$this->load->model('catalog/category');
$product_cat2 = $this->model_catalog_product->getCategories($product_id);
$result = $this->db->query("
SELECT
`c`.`parent_id`
FROM
`" . DB_PREFIX . "category` `c`
LEFT JOIN
`" . DB_PREFIX . "product_to_category` `p2c`
ON
`c`.`category_id` = `p2c`.`category_id`
WHERE
(`c`.`parent_id` = '1' OR `c`.`parent_id` = '1112')
AND
`p2c`.`product_id` = '" . (int) $product_id . "'
");
How would be best to now go about this?
Thank you,
Mike