From 4becd8399226a066e9d17e63c219e4aa36516e0a Mon Sep 17 00:00:00 2001 From: jpayne Date: Mon, 7 Jan 2013 13:47:15 -0500 Subject: [PATCH] Issue #1882390 by acrazyanimal: Making Address book work for customer profile panes that do not use the default checkout pane 'base' parameter functionality. --- commerce_addressbook.module | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commerce_addressbook.module b/commerce_addressbook.module index d1ff952..550813a 100644 --- a/commerce_addressbook.module +++ b/commerce_addressbook.module @@ -278,7 +278,7 @@ function commerce_addressbook_form_alter(&$form, &$form_state, $form_id) { foreach (commerce_checkout_panes(array('enabled' => TRUE, 'page' => $checkout_page_id)) as $pane_id => $checkout_pane) { // If this pane is a customer profile based pane build a list of previous // profiles from which to pick that are of the same bundle. - if ($checkout_pane['base'] == 'commerce_customer_profile_pane' && isset($form[$pane_id]) && variable_get('commerce_' . $pane_id . '_addressbook', FALSE)) { + if (substr($pane_id, 0, 16) == 'customer_profile' && isset($form[$pane_id]) && variable_get('commerce_' . $pane_id . '_addressbook', FALSE)) { $field = field_info_field(variable_get('commerce_' . $pane_id . '_field', '')); $profiles = commerce_customer_profile_load_multiple(array(), array('type' => $field['settings']['profile_type'], 'uid' => $user->uid, 'status' => TRUE)); @@ -366,7 +366,7 @@ function commerce_addressbook_form_alter(&$form, &$form_state, $form_id) { } } - if ($form_id == 'commerce_checkout_pane_settings_form' && $form['checkout_pane']['#value']['base'] == 'commerce_customer_profile_pane') { + if ($form_id == 'commerce_checkout_pane_settings_form' && substr($form['checkout_pane']['#value']['pane_id'], 0, 16) == 'customer_profile') { $form['settings']['commerce_' . $form['checkout_pane']['#value']['pane_id'] . '_addressbook'] = array( '#type' => 'checkbox', '#title' => t('Enable the Address Book'), -- 1.7.5.4