SELECT ROUND(AVG(p.price) ,0), c.id_category FROM psup_product p INNER JOIN psup_category_product pc ON p.id_product = pc.id_product INNER JOIN psup_category_product c ON pc.id_category = c.id_category GROUP BY c.id_category
want to use this command on php and assign smarty variable to use on category.tpl to get result on every category page to show product average price
any idea?
my version is prestashop 1.6.1.24