Hi everyone

Name field is not showing up on /admin/commerce/customer-profiles/list. I changed format handlers to 'Name (First name, Last name)' on /admin/commerce/customer-profiles/types/billing/fields/commerce_customer_address to have separate fields for First name and Last name. I am using PayPal's Website Payment Pro to accept orders.

Thanks in advance

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hasozduru’s picture

Project: Address Field » Commerce Core
Version: 7.x-1.0-beta2 » 7.x-1.3
Component: Code » Commerce
rszrama’s picture

Project: Commerce Core » Address Field
Version: 7.x-1.3 » 7.x-1.x-dev
Component: Commerce » Code

This was in the right spot. The issue is that we either need the "Name (First name, Last name)" option to combine the first and last name into the single name line column on save or we need the formatter to be able to use the right data depending on the option selected for name entry.

hasozduru’s picture

Thanks rszrama

I am not familiar with patches yet so would be great if you could provide one that fixes it.

kgrigsby@mac.com’s picture

I use the Address Field module with separate first and last name fields in the user's profile without Commerce. I have a View which displays the users and would like to have a a single filter field that searches on the combined first and last name. As it is right now I have a fields for the first and last name. I think if the combined name was stored on save it would make this possible.

hasozduru’s picture

rszrama, any update on this please?

rszrama’s picture

None, but it's been annoying me on my site, too. Obviously, this issue will be updated when there's an update.

mediapal’s picture

OMG I just stumbled into the same issue and here I realize this is going on since 10 Months. C'mon guys please give us a fix.

rszrama’s picture

I'd never turn away a patch. ; )

It's been bugging me for longer than this issue was posted, just never had the opportunity / luck to track it down.

rszrama’s picture

Title: Name field is empty on customer profiles » Update all name columns when a name is entered in either full name or first / last name form elements
Category: bug » feature
MVRider’s picture

I'm still seeing this issue. Has this been fixed or should I tackle it?

malovanets’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta4
Assigned: Unassigned » malovanets
Category: feature » support
FileSize
1012 bytes

Hello guys.

Hopefully this patch would solve the issue.

malovanets’s picture

I edited my patch a little, just to match the coding standards

rszrama’s picture

Category: support » task
Status: Active » Needs work

I think you intended something different with this if statement:

  if (isset($items[$delta]['first_name']) && isset($items[$delta]['first_name'])) {
    // ...
  }

As written, it's performing the same conditional check twice. Perhaps you meant to look for a last_name?

However, what happens if someone is using the name line format for the widget, saves the data - thereby populating the first / last names, and then attempts an update? Would it not cause the name line to be set to whatever the previous values of first / last name are? Or does this data here only include the data that specifically came from the widget?

malovanets’s picture

Oh... really...

<?php
  if (isset($items[$delta]['first_name']) && isset($items[$delta]['last_name'])) {
    // ...
  }
?>

It has to look like this. Thank's.

It receives the data from widget before saving to the database and updates all the 3 fields (first_name, last_name, name_line) all the time, when the data is changed.

malovanets’s picture

dwkitchen’s picture

It is possible, although why someone would, to have both first/last name and name line enable so perhaps it should be

  if (isset($items[$delta]['first_name']) && isset($items[$delta]['last_name']) && !isset($items[$delta]['name_line'])) {
    // ...
  }
malovanets’s picture

joshmiller’s picture

Issue summary: View changes
Status: Needs work » Needs review
rszrama’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Assigned: malovanets » Unassigned
Status: Needs review » Fixed

I simplified the logic of the split from the full name to first / last name. We can manipulate array values by reference via foreach and play with the PHP array API a little to make it easier to extract that first name. Have a look! : )

Commit: http://drupalcode.org/project/addressfield.git/commitdiff/4e31534

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.