Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Tom S. Posted September 13, 2015 Posted September 13, 2015 In IPB3 I could collect all the customer's data using the following code$info = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_customers', 'where' => "member_id={$memID}" ) );This created a very neat array with all the customers data. For example:$info['cm_first_name'] info['cm_address_1']; I do not know how I can replicate something similar in IPS4.I am guessing it will be something along the lines of\IPS\Db:: etc...Does anyone know how this can be done?Much appreciated.
Stuart Silvester Posted September 13, 2015 Posted September 13, 2015 You can access the customer object directly.<?php ... $customer = \IPS\nexus\Customer::load( $memberId ); /* Full Name */ $customerName = $customer->cm_name;
Tom S. Posted September 13, 2015 Author Posted September 13, 2015 You can access the customer object directly.<?php ... $customer = \IPS\nexus\Customer::load( $memberId ); /* Full Name */ $customerName = $customer->cm_name; Thanks, but I don't see billing information amongst the list of available variables. (unless I missed it).I only see [cm_first_name] => [cm_last_name] => [cm_phone] => [cm_profiles]To get billing info do I have to use a different command? Or is supposed to be in that list?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.