I want to sort Products based by their size like (extra small, small, medium, large) you can take Magento reference what they use for this term,) 1: Products with All Size options should be on top. you can see below query as refrence. SELECT sl.parent_id, COUNT(sl.product_id), SUM(IFNULL(ss.stock_status, 0)) FROM catalog_product_super_link […]