SELECT COUNT(DISTINCT p.product_id) AS total FROM ocmoto_product_to_category p2c LEFT JOIN ocmoto_product p ON (p2c.product_id = p.product_id) LEFT JOIN ocmoto_product_description pd ON (p.product_id = pd.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2c.category_id in (6252) AND p.price >= 0