It took me a while to figure out how to write my own MySQL query with the correct PHP syntax that Zen Cart likes. I thought I’d share it with you.
For example. Lets say you want to find out how many reviews were made for a particular product and display the number on the product description page. You would use the following and place it on your /includes/templates/YOUR-TEMPLATE/templates/tpl_product_info_display.php page. Of course, modify the style to match your page.
[php]
Execute($this_sku_sql_for_reviews);
if($this_sku_reviews->fields[‘status’] == 1) {
echo “
“. $this_sku_reviews->fields[‘products_id’].” reviews
“;
}
?>
[/php]
0 Comments