$query = 'SELECT DISTINCT a.virtuemart_product_id, a.product_parent_id, a.product_sku, a.virtuemart_vendor_id, a.product_in_stock, b.product_name, b.product_desc, d.product_tax_id, d.product_discount_id, d.product_price, d.product_override_price, d.override, d.product_currency, e.mf_name, e.virtuemart_manufacturer_id, g.virtuemart_category_id FROM (#__virtuemart_product_categories g LEFT JOIN (#__virtuemart_product_prices d RIGHT JOIN ((#__virtuemart_product_manufacturers f RIGHT JOIN #__virtuemart_products a ON f.virtuemart_product_id = a.virtuemart_product_id) LEFT JOIN #__virtuemart_manufacturers_'.$lang.' e ON f.virtuemart_manufacturer_id = e.virtuemart_manufacturer_id LEFT JOIN #__virtuemart_products_'.$lang.' b ON b.virtuemart_product_id = a.virtuemart_product_id) ON d.virtuemart_product_id = a.virtuemart_product_id) ON g.virtuemart_product_id = a.virtuemart_product_id) WHERE a.published = 1 AND d.product_price > 0 AND b.product_name <> \'\' AND g.virtuemart_category_id NOT IN ('.EXCLUDE_CAT.') AND a.virtuemart_product_id NOT IN ('.EXCLUDE_PROD.') GROUP BY a.virtuemart_product_id';