v00d0 Posted November 6, 2014 Share Posted November 6, 2014 Hi everybody, i'm trying to show in customers list (back office) a column with the groups where single customer is linked to and in orders list the vendor releated to the single product that has been sold. For customers i tried to add a select at the bottom of this query but nothing show up in the list. For orders i do not know from where to start. $this->_select = ' a.date_add, gl.name as title, ( SELECT SUM(total_paid_real / conversion_rate) FROM '._DB_PREFIX_.'orders o WHERE o.id_customer = a.id_customer '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').' AND a.active = 1 ) as total_spent, ( SELECT c.date_add FROM '._DB_PREFIX_.'guest g LEFT JOIN '._DB_PREFIX_.'connections c ON c.id_guest = g.id_guest WHERE g.id_customer = a.id_customer ORDER BY c.date_add DESC LIMIT 1 ) as connect, (SELECT GROUP_CONCAT(cg.id_group SEPARATOR ", ") FROM '._DB_PREFIX_.'customer_group cg WHERE cg.id_customer = a.id_customer GROUP BY cg.id_customer)'; i'm really newbie with prestashop i started to use it yestarday. many thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now