関数
Review::filterShippingAddressInfo( string $shipping_address_info, array $data, array $values, string $applyform, int $target_market_count )
Adds ‘change address’ button to shipping info section header of order summary table
パラメータ パラメータ
- $shipping_address_info
(文字列) (必須)
- $data
(配列) (必須)
- $values
(配列) (必須)
- $applyform
(文字列) (必須)
- $target_market_count
(数値) (必須)
ファイル: src/Views/ConfirmPageReview/Review.php
protected function filterShippingAddressInfo( $shipping_address_info, $data, $values, $applyform, $target_market_count ) { global $usces_settings; if ($this->module->getActingOpts()['address_priority'] === 'welcart') { return $shipping_address_info; } // phpcs:disable WordPress.WP.I18n.NoEmptyStrings $type = 'confirm'; switch ($applyform) { case 'JP': $shipping_address_info = $this->checkoutDetailsComp->getAddressTableHeader(); $shipping_address_info .= usces_custom_field_info($data, 'delivery', 'name_pre', 'return'); /** * 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>'; $deli_furigana = ('' == (trim($values['delivery']['name3']) . trim($values['delivery']['name4']))) ? '' : sprintf(_x('%s', 'honorific', 'usces'), (esc_html($values['delivery']['name3']) . ' ' . esc_html($values['delivery']['name4']))); $furigana_delivery = '<tr class="furikana-row delivery-furikana-row"><th>' . __('furigana', 'usces') . '</th><td>' . $deli_furigana . '</td></tr>'; /** * Mirrored Welcart filter * * @ignore */ $shipping_address_info .= apply_filters('usces_filter_furigana_confirm_delivery', $furigana_delivery, $type, $values); $shipping_address_info .= usces_custom_field_info($values, 'delivery', 'name_after', 'return'); $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> <tr class="fax-row delivery-fax-row"><th>' . __('FAX number', 'usces') . '</th><td>' . esc_html($values['delivery']['fax']) . '</td></tr>'; $shipping_address_info .= usces_custom_field_info($data, 'delivery', 'fax_after', 'return'); break; case 'CN': $shipping_address_info = $this->checkoutDetailsComp->getAddressTableHeader(); $shipping_address_info .= usces_custom_field_info($data, 'delivery', 'name_pre', 'return'); /** * 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>'; $shipping_address_info .= usces_custom_field_info($data, 'delivery', 'name_after', 'return'); 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> <tr class="fax-row delivery-fax-row"><th>' . __('FAX number', 'usces') . '</th><td>' . esc_html($values['delivery']['fax']) . '</td></tr>'; $shipping_address_info .= usces_custom_field_info($data, 'delivery', 'fax_after', 'return'); break; case 'US': default: $delivery_pref = ($values['delivery']['pref'] == __('-- Select --', 'usces') || $values['delivery']['pref'] == '-- Select --') ? '' : $values['delivery']['pref']; $shipping_address_info = $this->checkoutDetailsComp->getAddressTableHeader(); $shipping_address_info .= usces_custom_field_info($data, 'delivery', 'name_pre', 'return'); /** * 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 .= usces_custom_field_info($data, 'delivery', 'name_after', 'return'); $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> <tr class="fax-row delivery-fax-row"><th>' . __('FAX number', 'usces') . '</th><td>' . esc_html($values['delivery']['fax']) . '</td></tr>'; $shipping_address_info .= usces_custom_field_info($data, 'delivery', 'fax_after', 'return'); break; } // phpcs:enable return $shipping_address_info; }