SELECT c.id, /*c.promocode, */ ci.id AS cart_item_id, ci.gift_id AS cart_item_gift_id, ci.gift_price AS cart_item_gift_price, ci.product_id AS cart_item_product_id, ci.qty AS cart_item_qty, ci.price AS cart_item_price, p.type_id AS product_type_id, p.qty AS product_qty FROM cart as c LEFT JOIN cart_items as ci ON ci.cart_id = c.id JOIN products as p ON p.id = ci.product_id WHERE ci.product_id != '' AND ( (p.active = '1' AND p.status >1) OR p.id IN (203902) ) AND (p.title IS NOT NULL ) AND ci.qty != '' AND c.id=0