関数
AmazonCheckoutDetails::confirmAddressTable( array $data )
住所テーブルに ‘住所変更’ を追加
パラメータ パラメータ
- $data
(配列) (必須)
ファイル: src/Components/AmazonCheckoutDetails/AmazonCheckoutDetails.php
public function confirmAddressTable($data) { global $usces, $usces_settings; $options = get_option('usces'); $form = $options['system']['addressform']; $applyform = usces_get_apply_addressform($form); $formtag = ''; $values = $data; $type = 'confirm'; $data['type'] = 'confirm'; $values['country'] = !empty($values['country']) ? $values['country'] : usces_get_local_addressform(); $values = $usces->stripslashes_deep_post($values); $target_market_count = (isset($options['system']['target_market']) && is_array($options['system']['target_market'])) ? count($options['system']['target_market']) : 1; // phpcs:disable WordPress.WP.I18n.NoEmptyStrings switch ($applyform) { case 'JP': /** * Mirrored Welcart filter * * @ignore */ $formtag .= '<tr v-if="!hideCustomerInfo" class="name-row member-name-row"><th>' . apply_filters('usces_filters_addressform_name_label', __('Full name', 'usces'), $type, $values, $applyform) . '</th><td>' . esc_html(sprintf(_x('%s', 'honorific', 'usces'), (esc_html($values['customer']['name1']) . ' ' . esc_html($values['customer']['name2'])))) . '</td></tr>'; if (usces_is_login()) { $furigana = ('' == (trim($values['customer']['name3']) . trim($values['customer']['name4']))) ? '' : sprintf(_x('%s', 'honorific', 'usces'), (esc_html($values['customer']['name3']) . ' ' . esc_html($values['customer']['name4']))); $furigana_customer = '<tr class="furikana-row member-furikana-row"><th>' . __('furigana', 'usces') . '</th><td>' . $furigana . '</td></tr>'; /** * Mirrored Welcart filter * * @ignore */ $formtag .= apply_filters('usces_filter_furigana_confirm_customer', $furigana_customer, $type, $values); $formtag .= '<tr class="zipcode-row member-zipcode-row"><th>' . __('Zip/Postal Code', 'usces') . '</th><td>' . esc_html($values['customer']['zipcode']) . '</td></tr>'; if (1 < $target_market_count) { $customer_country = (!empty($usces_settings['country'][$values['customer']['country']])) ? $usces_settings['country'][$values['customer']['country']] : ''; $formtag .= '<tr class="country-row member-country-row"><th>' . __('Country', 'usces') . '</th><td>' . esc_html($customer_country) . '</td></tr>'; } $customer_pref = ($values['customer']['pref'] == __('-- Select --', 'usces') || $values['customer']['pref'] == '-- Select --') ? '' : $values['customer']['pref']; $formtag .= ' <tr class="states-row member-states-row"><th>' . __('Province', 'usces') . '</th><td>' . esc_html($customer_pref) . '</td></tr> <tr class="address1-row member-address1-row"><th>' . __('city', 'usces') . '</th><td>' . esc_html($values['customer']['address1']) . '</td></tr> <tr class="address2-row member-address2-row"><th>' . __('numbers', 'usces') . '</th><td>' . esc_html($values['customer']['address2']) . '</td></tr> <tr class="address3-row member-address3-row"><th>' . __('building name', 'usces') . '</th><td>' . esc_html($values['customer']['address3']) . '</td></tr> <tr class="tel-row member-tel-row"><th>' . __('Phone number', 'usces') . '</th><td>' . esc_html($values['customer']['tel']) . '</td></tr> <tr class="fax-row member-fax-row"><th>' . __('FAX number', 'usces') . '</th><td>' . esc_html($values['customer']['fax']) . '</td></tr>'; } $shipping_address_info = ''; if (isset($values['delivery'])) { $shipping_address_info = $this->getAddressTableHeader(); /** * Mirrored Welcart filter * * @ignore */ $shipping_address_info .= '<tr class="name-row delivery-name-row"><th>' . apply_filters('usces_filters_addressform_name_label', __('Full name', 'usces'), $type, $values, $applyform) . '</th><td>' . sprintf(_x('%s', 'honorific', 'usces'), (esc_html($values['delivery']['name1']) . ' ' . esc_html($values['delivery']['name2']))) . '</td></tr>'; $shipping_address_info .= '<tr class="zipcode-row delivery-zipcode-row"><th>' . __('Zip/Postal Code', 'usces') . '</th><td>' . esc_html($values['delivery']['zipcode']) . '</td></tr>'; if (1 < $target_market_count) { $shipping_country = (!empty($usces_settings['country'][$values['delivery']['country']])) ? $usces_settings['country'][$values['delivery']['country']] : ''; $shipping_address_info .= '<tr class="country-row delivery-country-row"><th>' . __('Country', 'usces') . '</th><td>' . esc_html($shipping_country) . '</td></tr>'; } $delivery_pref = ($values['delivery']['pref'] == __('-- Select --', 'usces') || $values['delivery']['pref'] == '-- Select --') ? '' : $values['delivery']['pref']; $shipping_address_info .= ' <tr class="states-row delivery-states-row"><th>' . __('Province', 'usces') . '</th><td>' . esc_html($delivery_pref) . '</td></tr> <tr class="address1-row delivery-address1-row"><th>' . __('city', 'usces') . '</th><td>' . esc_html($values['delivery']['address1']) . '</td></tr> <tr class="address2-row delivery-address2-row"><th>' . __('numbers', 'usces') . '</th><td>' . esc_html($values['delivery']['address2']) . '</td></tr> <tr class="address3-row delivery-address3-row"><th>' . __('building name', 'usces') . '</th><td>' . esc_html($values['delivery']['address3']) . '</td></tr> <tr class="tel-row delivery-tel-row"><th>' . __('Phone number', 'usces') . '</th><td>' . esc_html($values['delivery']['tel']) . '</td></tr>'; } $formtag .= $shipping_address_info; break; case 'CN': /** * Mirrored Welcart filter * * @ignore */ $formtag .= '<tr v-if="!hideCustomerInfo" class="name-row member-name-row"><th>' . apply_filters('usces_filters_addressform_name_label', __('Full name', 'usces'), $type, $values, $applyform) . '</th><td>' . sprintf(_x('%s', 'honorific', 'usces'), esc_html(usces_localized_name($values['customer']['name1'], $values['customer']['name2'], 'return'))) . '</td></tr>'; if (usces_is_login()) { if (1 < $target_market_count) { $customer_country = (!empty($usces_settings['country'][$values['customer']['country']])) ? $usces_settings['country'][$values['customer']['country']] : ''; $formtag .= '<tr class="country-row member-country-row"><th>' . __('Country', 'usces') . '</th><td>' . esc_html($customer_country) . '</td></tr>'; } $customer_pref = ($values['customer']['pref'] == __('-- Select --', 'usces') || $values['customer']['pref'] == '-- Select --') ? '' : $values['customer']['pref']; $formtag .= ' <tr class="states-row member-states-row"><th>' . __('State', 'usces') . '</th><td>' . esc_html($customer_pref) . '</td></tr> <tr class="address1-row member-address1-row"><th>' . __('city', 'usces') . '</th><td>' . esc_html($values['customer']['address1']) . '</td></tr> <tr class="address2-row member-address2-row"><th>' . __('Address Line1', 'usces') . '</th><td>' . esc_html($values['customer']['address2']) . '</td></tr> <tr class="address3-row member-address3-row"><th>' . __('Address Line2', 'usces') . '</th><td>' . esc_html($values['customer']['address3']) . '</td></tr> <tr class="zipcode-row member-zipcode-row"><th>' . __('Zip', 'usces') . '</th><td>' . esc_html($values['customer']['zipcode']) . '</td></tr> <tr class="tel-row member-tel-row"><th>' . __('Phone number', 'usces') . '</th><td>' . esc_html($values['customer']['tel']) . '</td></tr> <tr class="fax-row member-fax-row"><th>' . __('FAX number', 'usces') . '</th><td>' . esc_html($values['customer']['fax']) . '</td></tr>'; } $shipping_address_info = ''; if (isset($values['delivery'])) { $shipping_address_info = $this->getAddressTableHeader(); /** * Mirrored Welcart filter * * @ignore */ $shipping_address_info .= '<tr class="name-row delivery-name-row"><th>' . apply_filters('usces_filters_addressform_name_label', __('Full name', 'usces'), $type, $values, $applyform) . '</th><td>' . sprintf(_x('%s', 'honorific', 'usces'), esc_html(usces_localized_name($values['delivery']['name1'], $values['delivery']['name2'], 'return'))) . '</td></tr>'; if (1 < $target_market_count) { $shipping_country = (!empty($usces_settings['country'][$values['delivery']['country']])) ? $usces_settings['country'][$values['delivery']['country']] : ''; $shipping_address_info .= '<tr class="country-row delivery-country-row"><th>' . __('Country', 'usces') . '</th><td>' . esc_html($shipping_country) . '</td></tr>'; } $delivery_pref = ($values['delivery']['pref'] == __('-- Select --', 'usces') || $values['delivery']['pref'] == '-- Select --') ? '' : $values['delivery']['pref']; $shipping_address_info .= ' <tr class="states-row delivery-states-row"><th>' . __('State', 'usces') . '</th><td>' . esc_html($delivery_pref) . '</td></tr> <tr class="address1-row delivery-address1-row"><th>' . __('city', 'usces') . '</th><td>' . esc_html($values['delivery']['address1']) . '</td></tr> <tr class="address2-row delivery-address2-row"><th>' . __('Address Line1', 'usces') . '</th><td>' . esc_html($values['delivery']['address2']) . '</td></tr> <tr class="address3-row delivery-address3-row"><th>' . __('Address Line2', 'usces') . '</th><td>' . esc_html($values['delivery']['address3']) . '</td></tr> <tr class="zipcode-row delivery-zipcode-row"><th>' . __('Zip', 'usces') . '</th><td>' . esc_html($values['delivery']['zipcode']) . '</td></tr> <tr class="tel-row delivery-tel-row"><th>' . __('Phone number', 'usces') . '</th><td>' . esc_html($values['delivery']['tel']) . '</td></tr>'; } $formtag .= $shipping_address_info; break; case 'US': default: /** * Mirrored Welcart filter * * @ignore */ $formtag .= '<tr v-if="!hideCustomerInfo" class="name-row member-name-row"><th>' . apply_filters('usces_filters_addressform_name_label', __('Full name', 'usces'), $type, $values, $applyform) . '</th><td>' . sprintf(_x('%s', 'honorific', 'usces'), (esc_html($values['customer']['name2']) . ' ' . esc_html($values['customer']['name1']))) . '</td></tr>'; if (usces_is_login()) { $customer_pref = ($values['customer']['pref'] == __('-- Select --', 'usces') || $values['customer']['pref'] == '-- Select --') ? '' : $values['customer']['pref']; $formtag .= ' <tr class="address2-row member-address2-row"><th>' . __('Address Line1', 'usces') . '</th><td>' . esc_html($values['customer']['address2']) . '</td></tr> <tr class="address3-row member-address3-row"><th>' . __('Address Line2', 'usces') . '</th><td>' . esc_html($values['customer']['address3']) . '</td></tr> <tr class="address1-row member-address1-row"><th>' . __('city', 'usces') . '</th><td>' . esc_html($values['customer']['address1']) . '</td></tr> <tr class="states-row member-states-row"><th>' . __('State', 'usces') . '</th><td>' . esc_html($customer_pref) . '</td></tr>'; if (1 < $target_market_count) { $customer_country = (!empty($usces_settings['country'][$values['customer']['country']])) ? $usces_settings['country'][$values['customer']['country']] : ''; $formtag .= '<tr class="country-row member-country-row"><th>' . __('Country', 'usces') . '</th><td>' . esc_html($customer_country) . '</td></tr>'; } $formtag .= ' <tr class="zipcode-row member-zipcode-row"><th>' . __('Zip', 'usces') . '</th><td>' . esc_html($values['customer']['zipcode']) . '</td></tr> <tr class="tel-row member-tel-row"><th>' . __('Phone number', 'usces') . '</th><td>' . esc_html($values['customer']['tel']) . '</td></tr> <tr class="fax-row member-fax-row"><th>' . __('FAX number', 'usces') . '</th><td>' . esc_html($values['customer']['fax']) . '</td></tr>'; } $shipping_address_info = ''; if (isset($values['delivery'])) { $delivery_pref = ($values['delivery']['pref'] == __('-- Select --', 'usces') || $values['delivery']['pref'] == '-- Select --') ? '' : $values['delivery']['pref']; $shipping_address_info = $this->getAddressTableHeader(); /** * Mirrored Welcart filter * * @ignore */ $shipping_address_info .= '<tr class="name-row delivery-name-row"><th>' . apply_filters('usces_filters_addressform_name_label', __('Full name', 'usces'), $type, $values, $applyform) . '</th><td>' . sprintf(_x('%s', 'honorific', 'usces'), (esc_html($values['delivery']['name2']) . ' ' . esc_html($values['delivery']['name1']))) . '</td></tr>'; $shipping_address_info .= ' <tr class="address2-row delivery-address2-row"><th>' . __('Address Line1', 'usces') . '</th><td>' . esc_html($values['delivery']['address2']) . '</td></tr> <tr class="address3-row delivery-address3-row"><th>' . __('Address Line2', 'usces') . '</th><td>' . esc_html($values['delivery']['address3']) . '</td></tr> <tr class="address1-row delivery-address1-row"><th>' . __('city', 'usces') . '</th><td>' . esc_html($values['delivery']['address1']) . '</td></tr> <tr class="states-row delivery-states-row"><th>' . __('State', 'usces') . '</th><td>' . esc_html($delivery_pref) . '</td></tr>'; if (1 < $target_market_count) { $shipping_country = (!empty($usces_settings['country'][$values['delivery']['country']])) ? $usces_settings['country'][$values['delivery']['country']] : ''; $shipping_address_info .= '<tr class="country-row delivery-country-row"><th>' . __('Country', 'usces') . '</th><td>' . esc_html($shipping_country) . '</td></tr>'; } $shipping_address_info .= ' <tr class="zipcode-row delivery-zipcode-row"><th>' . __('Zip', 'usces') . '</th><td>' . esc_html($values['delivery']['zipcode']) . '</td></tr> <tr class="tel-row delivery-tel-row"><th>' . __('Phone number', 'usces') . '</th><td>' . esc_html($values['delivery']['tel']) . '</td></tr>'; } $formtag .= $shipping_address_info; break; } // phpcs:enable echo $formtag; }