Jump to content

Fetching Customer Info


Tom S.

Recommended Posts

Posted

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.

Posted

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?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...