Fatal error: Uncaught Exception: Error: Unknown column 'p2.product_id' in 'field list'
Error No: 1054
SELECT p.product_id,
COUNT(DISTINCT p2.product_id) AS group_count,
AVG(r.rating) AS rating,
MIN(pd2.price) AS discount,
MIN(ps.price) AS special
FROM oc_product p
LEFT JOIN oc_ocfilter_filter_value_to_product fv2p1 ON (p.product_id = fv2p1.product_id) LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id)
LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id)
LEFT JOIN oc_product_to_category p2c ON (p.product_id = p2c.product_id)
LEFT JOIN oc_product_filter pf ON (p.product_id = pf.product_id)
LEFT JOIN oc_review r ON (r.product_id = p.product_id AND r.status = '1')
LEFT JOIN oc_product_discount pd2 ON (p.product_id = pd2.product_id
AND pd2.customer_group_id = '1'
AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW())
AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())))
in /home/soft/tep.ua/system/library/db/mysqli.php on line 40