Skip to main content
added 1458 characters in body
Source Link
jchwebdev
  • 590
  • 2
  • 12
  • 28

Commerce Kickstart 2.

I used the included Feed to import users. I applied this patch: https://www.drupal.org/node/1570544 so I could keep the existing UIDs. Seemed to work OK.

I then wrote a script to import sales orders from an external db. That too seemed to go OK, except that the Username displayed on all reports, views, in fact -anywhere- that the field User:Name is displayed, it shows the First Name/Last Name of the billing profile of the last linked order. eg.

The username is 'MEGACORP'. But 'Frank Smith' is displayed as the User Name because that was the First/Last name of the imported order. -And- the link to the user account profile is users/frank_smith

The weird thing is that when people log in, they getlog in with the -correct- Username, ie. megacorp., -not- Frank_Smith

I looked at the SQL table Users and the Username is correct. (ie. megacorp)

AND I stumbled on creating a view of users, but as a wild-ass-guess set a relation to node entity reference and the Title field is 'Megacorp'.

Here are my field mappings in my customer profile import:

// Full Name(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['name_line'] = $name;
// Country(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['country'] = $row->country_iso_code_2;
// Address 1(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['thoroughfare'] = $row->billing_street1;
// Address 2
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['premise'] = $row->billing_street2;
// City(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['locality'] = $row->billing_city;
// State(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['administrative_area'] = $row->zone_code;
// Postal Code(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['postal_code'] = $row->billing_postal_code;
//Business name(Required)
$profile_billing->field_business_name[LANGUAGE_NONE][0]['value'] = $row->billing_company;
 // Phone(Required)
$profile_billing->field_phone_number[LANGUAGE_NONE][0]['value'] = $row->billing_phone;`

So...

  1. why is Username not pulling from the Users SQL table?

  2. Is the above behaviour something Commerce does? If so, can I turn it -off-?

  3. Is there -always- a related node for each user?

  4. The field billing_company doesn't seem to display on any view, even though it is available to import. How do I access -that-? I guess -that- is what I expected to appear on various forms/reports (eg. the invoice)

Commerce Kickstart 2.

I used the included Feed to import users. I applied this patch: https://www.drupal.org/node/1570544 so I could keep the existing UIDs. Seemed to work OK.

I then wrote a script to import sales orders from an external db. That too seemed to go OK, except that the Username displayed on all reports, views, in fact -anywhere- that the field User:Name is displayed, it shows the First Name/Last Name of the billing profile of the last linked order. eg.

The username is 'MEGACORP'. But 'Frank Smith' is displayed as the User Name because that was the First/Last name of the imported order. -And- the link to the user account profile is users/frank_smith

The weird thing is that when people log in, they get the -correct- Username, ie. megacorp.

I looked at the SQL table Users and the Username is correct. (ie. megacorp)

AND I stumbled on creating a view of users, but as a wild-ass-guess set a relation to node entity reference and the Title field is 'Megacorp'.

So...

  1. why is Username not pulling from the Users SQL table?

  2. Is the above behaviour something Commerce does? If so, can I turn it -off-?

  3. Is there -always- a related node for each user?

Commerce Kickstart 2.

I used the included Feed to import users. I applied this patch: https://www.drupal.org/node/1570544 so I could keep the existing UIDs. Seemed to work OK.

I then wrote a script to import sales orders from an external db. That too seemed to go OK, except that the Username displayed on all reports, views, in fact -anywhere- that the field User:Name is displayed, it shows the First Name/Last Name of the billing profile of the last linked order. eg.

The username is 'MEGACORP'. But 'Frank Smith' is displayed as the User Name because that was the First/Last name of the imported order. -And- the link to the user account profile is users/frank_smith

The weird thing is that when people log in, they log in with the -correct- Username, ie. megacorp, -not- Frank_Smith

I looked at the SQL table Users and the Username is correct. (ie. megacorp)

AND I stumbled on creating a view of users, but as a wild-ass-guess set a relation to node entity reference and the Title field is 'Megacorp'.

Here are my field mappings in my customer profile import:

// Full Name(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['name_line'] = $name;
// Country(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['country'] = $row->country_iso_code_2;
// Address 1(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['thoroughfare'] = $row->billing_street1;
// Address 2
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['premise'] = $row->billing_street2;
// City(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['locality'] = $row->billing_city;
// State(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['administrative_area'] = $row->zone_code;
// Postal Code(Required)
$profile_billing->commerce_customer_address[LANGUAGE_NONE][0]['postal_code'] = $row->billing_postal_code;
//Business name(Required)
$profile_billing->field_business_name[LANGUAGE_NONE][0]['value'] = $row->billing_company;
 // Phone(Required)
$profile_billing->field_phone_number[LANGUAGE_NONE][0]['value'] = $row->billing_phone;`

So...

  1. why is Username not pulling from the Users SQL table?

  2. Is the above behaviour something Commerce does? If so, can I turn it -off-?

  3. Is there -always- a related node for each user?

  4. The field billing_company doesn't seem to display on any view, even though it is available to import. How do I access -that-? I guess -that- is what I expected to appear on various forms/reports (eg. the invoice)

Source Link
jchwebdev
  • 590
  • 2
  • 12
  • 28

Does Commerce Override Username Or Is Username Linked To A Node?

Commerce Kickstart 2.

I used the included Feed to import users. I applied this patch: https://www.drupal.org/node/1570544 so I could keep the existing UIDs. Seemed to work OK.

I then wrote a script to import sales orders from an external db. That too seemed to go OK, except that the Username displayed on all reports, views, in fact -anywhere- that the field User:Name is displayed, it shows the First Name/Last Name of the billing profile of the last linked order. eg.

The username is 'MEGACORP'. But 'Frank Smith' is displayed as the User Name because that was the First/Last name of the imported order. -And- the link to the user account profile is users/frank_smith

The weird thing is that when people log in, they get the -correct- Username, ie. megacorp.

I looked at the SQL table Users and the Username is correct. (ie. megacorp)

AND I stumbled on creating a view of users, but as a wild-ass-guess set a relation to node entity reference and the Title field is 'Megacorp'.

So...

  1. why is Username not pulling from the Users SQL table?

  2. Is the above behaviour something Commerce does? If so, can I turn it -off-?

  3. Is there -always- a related node for each user?