If I not use "address field" in Billing information (Screenshot 1) I will get empty title for my file address (Screenshot 2). How I can get value from own fields, for example Street and House number and save this value in title address book? You can suggest, where save title in line code?
Sorry my english(

CommentFileSizeAuthor
screenshot 2.png61.6 KBmozh92
screenshot 1.png102.21 KBmozh92
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mozh92 created an issue. See original summary.

mozh92’s picture

317 line commerce_addressbook.module

          // Prepare the options.
          $options = array();
          foreach ($profiles as $id => $profile) {
            $title_address = '';
            $field_values = array();
            //$field_values = field_get_items('commerce_customer_profile', $profile, 'commerce_customer_address');
            $field_values[] = field_get_items('commerce_customer_profile', $profile, 'field_company_bil');
            $field_values[] = field_get_items('commerce_customer_profile', $profile, 'field_street_bil');
            $field_values[] = field_get_items('commerce_customer_profile', $profile, 'field_house_bil');
            $field_values[] = field_get_items('commerce_customer_profile', $profile, 'field_city_bil');
            $field_values[] = field_get_items('commerce_customer_profile', $profile, 'field_country_bil');
            $field_values[] = field_get_items('commerce_customer_profile', $profile, 'field_postal_code_bil');
            if(!empty($field_values)) {
              $count = count($field_values);
              foreach ($field_values as $field_value) {
                if(!empty($field_value)) {
                  $title_address .= $field_value[0]['value'];
                  $count--;
                  if ($count > 0)
                    $title_address .= ', ';
                }
              }
            }
            $options[$id] = $title_address;
          }
lukasss’s picture

Status: Active » Closed (duplicate)