SELECT
tab_count.product_id,
tab_count.total,
ocp.status
FROM (SELECT
product_id,
count(product_id) AS total
FROM oc_order_product
GROUP BY product_id
ORDER BY total DESC) AS tab_count,
oc_product AS ocp
WHERE ocp.status = '1' AND ocp.product_id = tab_count.product_id
GROUP BY tab_count.product_id
ORDER BY tab_count.total DESC