Im biggner in opencart my issue is I add field in product table called (model_choice) , in the product.tpl page in path (catalog/view/theme/default/template/product/product.tpl) I want to get the value of the row (model_choice) for the selected product I already get the product id with
$sql = $this->db->query('SELECT model_choice
WHERE product_id = ' . $this->request->get['product_id']);
$id = $sql ->model_choice;
$id = $sql->row['model_choice']; - Try this.
print_r($sql->rows); \\Shows all results.
Refer this link: How to become an OpenCart guru?