返信先: お客様情報確認部分のフックについて

ホーム フォーラム その他 お客様情報確認部分のフックについて 返信先: お客様情報確認部分のフックについて

#72188

ckh37583
参加者

functions.phpの添付ができなかったので、こちらに該当部分を記載します。
よろしくお願いいたします。

——————————
add_filter( ‘usces_filter_apply_addressform’, ‘my_filter_apply_addressform’, 10, 3);
function my_filter_apply_addressform($formtag, $type, $data){
global $usces, $usces_settings;
$options = get_option(‘usces’);
$form = $options[‘system’][‘addressform’];
$nameform = $usces_settings[‘nameform’][$form];
$applyform = usces_get_apply_addressform($form);
$formtag = ”;
switch( $type ){
case ‘confirm’:
case ‘member’:
$values = $data;
break;
case ‘customer’:
case ‘delivery’:
$values = $data[$type];
break;
}
$data[‘type’] = $type;
if( ‘confirm’ == $type ){
$formtag = ”;
$formtag .= usces_custom_field_info($data, ‘customer’, ‘name_pre’, ‘return’);
$formtag .= ‘<dt>’.__(‘Full name’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘name1’]) . ‘ ‘ . esc_html($values[‘customer’][‘name2’]) . ‘</dd>’;
$furigana_customer = ‘<dt>’.__(‘furigana’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘name3’]) . ‘ ‘ . esc_html($values[‘customer’][‘name4’]) . ‘</dd>’;
$formtag .= apply_filters( ‘usces_filter_furigana_confirm_customer’, $furigana_customer, $type, $values );
$formtag .= usces_custom_field_info($data, ‘customer’, ‘name_after’, ‘return’);
$formtag .= ‘<dt>’.__(‘Zip/Postal Code’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘zipcode’]) . ‘</dd>’;

$formtag .= ‘
<dt>’.__(‘Province’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘pref’]) . ‘</dd>
<dt>’.__(‘city’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘address1’]) . ‘</dd>
<dt>’.__(‘numbers’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘address2’]) . ‘</dd>
<dt>’.__(‘building name’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘address3’]) . ‘</dd>
<dt>’.__(‘Phone number’, ‘usces’).'</dt><dd>’ . esc_html($values[‘customer’][‘tel’]) . ‘</dd>’;
$formtag .= usces_custom_field_info($data, ‘customer’, ‘fax_after’, ‘return’);

$shipping_address_info = ‘</dl><h2>配送先</h2><dl>’;
$shipping_address_info .= usces_custom_field_info($data, ‘delivery’, ‘name_pre’, ‘return’);
$shipping_address_info .= ‘<dt>’.__(‘Full name’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘name1’]) . ‘ ‘ . esc_html($values[‘delivery’][‘name2’]) . ‘</dd>’;
$furigana_delivery = ‘<dt>’.__(‘furigana’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘name3’]) . ‘ ‘ . esc_html($values[‘delivery’][‘name4’]) . ‘</dd>’;
$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 .= ‘<dt>’.__(‘Zip/Postal Code’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘zipcode’]) . ‘</dd>’;

$shipping_address_info .= ‘
<dt>’.__(‘Province’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘pref’]) . ‘</dd>
<dt>’.__(‘city’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘address1’]) . ‘</dd>
<dt>’.__(‘numbers’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘address2’]) . ‘</dd>
<dt>’.__(‘building name’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘address3’]) . ‘</dd>
<dt>’.__(‘Phone number’, ‘usces’).'</dt><dd>’ . esc_html($values[‘delivery’][‘tel’]) . ‘</dd>’;
$shipping_address_info .= usces_custom_field_info($data, ‘delivery’, ‘fax_after’, ‘return’);
$formtag .= apply_filters(‘usces_filter_shipping_address_info’, $shipping_address_info);
}

else{
$formtag .= usces_custom_field_input($data, $type, ‘name_pre’, ‘return’);
$formtag .= ‘<dt>’ . __(‘Full name’, ‘usces’).'<span class=”must”>必須</span></dt>’;
if( $nameform ){
$formtag .= ‘<dd><span class=”harf”>’.__(‘Given name’, ‘usces’).'<input name=”‘ . $type . ‘[name2]” id=”name2″ type=”text” value=”‘ . esc_attr($values[‘name2’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span>’;
$formtag .= ‘<span class=”harf”>’.__(‘Familly name’, ‘usces’).'<input name=”‘ . $type . ‘[name1]” id=”name1″ type=”text” value=”‘ . esc_attr($values[‘name1’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span></dd>’;
}else{
$formtag .= ‘<dd><span class=”harf”>’.__(‘Familly name’, ‘usces’).'<input name=”‘ . $type . ‘[name1]” id=”name1″ type=”text” value=”‘ . esc_attr($values[‘name1’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span>’;
$formtag .= ‘<span class=”harf”>’.__(‘Given name’, ‘usces’).'<input name=”‘ . $type . ‘[name2]” id=”name2″ type=”text” value=”‘ . esc_attr($values[‘name2’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span></dd>’;
}
$formtag .= ”;
$furigana = ‘<dt>’ .__(‘furigana’, ‘usces’).'<span class=”must”>必須</span></dt>’;
if( $nameform ){
$furigana .= ‘<dd><span class=”harf”>’.__(‘Given name’, ‘usces’).'<input name=”‘ . $type . ‘[name4]” id=”name4″ type=”text” value=”‘ . esc_attr($values[‘name4’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span>’;
$furigana .= ‘<span class=”harf”>’.__(‘Familly name’, ‘usces’).'<input name=”‘ . $type . ‘[name3]” id=”name3″ type=”text” value=”‘ . esc_attr($values[‘name3’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span></dd>’;
}else{
$furigana .= ‘<dd><span class=”harf”>’.__(‘Familly name’, ‘usces’).'<input name=”‘ . $type . ‘[name3]” id=”name3″ type=”text” value=”‘ . esc_attr($values[‘name3’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span>’;
$furigana .= ‘<span class=”harf”>’.__(‘Given name’, ‘usces’).'<input name=”‘ . $type . ‘[name4]” id=”name4″ type=”text” value=”‘ . esc_attr($values[‘name4’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” /></span></dd>’;
}
$furigana .= ”;
$formtag .= apply_filters( ‘usces_filter_furigana_form’, $furigana, $type, $values );
$formtag .= usces_custom_field_input($data, $type, ‘name_after’, ‘return’);
$formtag .= ‘
<dt>’ .__(‘Zip/Postal Code’, ‘usces’).'<span class=”must”>必須</span></dt>
<dd class=”postalCode”><input name=”‘ . $type . ‘[zipcode]” id=”zipcode” type=”text” value=”‘ . esc_attr($values[‘zipcode’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: inactive” />’.apply_filters(‘usces_filter_addressform_zipcode’, NULL, $type) . apply_filters( ‘usces_filter_after_zipcode’, ‘例 : 000-0000’, $applyform ) . ‘</dd>
‘;
$formtag .= ‘
<dt>’.__(‘Province’, ‘usces’).'<span class=”must”>必須</span></dt>
<dd>’ . usces_pref_select( $type, $values ) . apply_filters( ‘usces_filter_after_states’, NULL, $applyform ) . ‘</dd>

<dt>’ .__(‘city’, ‘usces’).'<span class=”must”>必須</span></dt>
<dd colspan=”2″><input name=”‘ . $type . ‘[address1]” id=”address1″ type=”text” value=”‘ . esc_attr($values[‘address1’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” />’ . apply_filters( ‘usces_filter_after_address1’, __(‘例 : ○○県○○市’, ‘usces’), $applyform ) . ‘</dd>

<dt>’.__(‘numbers’, ‘usces’).'<span class=”must”>必須</span></dt>
<dd><input name=”‘ . $type . ‘[address2]” id=”address2″ type=”text” value=”‘ . esc_attr($values[‘address2’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” />’ . ‘<span class=”example”>’. apply_filters( ‘usces_filter_after_address2’, ‘例 : 1-23-456’, $applyform ) . ‘</span></dd>

<dt>’.__(‘building name’, ‘usces’).'</dt>
<dd><input name=”‘ . $type . ‘[address3]” id=”address3″ type=”text” value=”‘ . esc_attr($values[‘address3’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: active” />’ . ‘<span class=”example”>’. apply_filters( ‘usces_filter_after_address3’, __(‘例 : ○○ビル 201号室’, ‘usces’), $applyform ) . ‘</span></dd>

<dt>’.__(‘Phone number’, ‘usces’).'<span class=”must”>必須</span></dt>
<dd><input name=”‘ . $type . ‘[tel]” id=”tel” type=”text” value=”‘ . esc_attr($values[‘tel’]) . ‘” onKeyDown=”if (event.keyCode == 13) {return false;}” style=”ime-mode: inactive” />’ . ‘<span class=”example”>’. apply_filters( ‘usces_filter_after_tel’, ‘例 : 01-2345-6789’, $applyform ) . ‘</span></dd>’;
$formtag .= usces_custom_field_input($data, $type, ‘fax_after’, ‘return’);

$res = apply_filters(‘my_filter_apply_addressform’, $formtag, $type, $data);
}

if($out == ‘return’) {
return $res;
} else {
echo $res;
}
}
——————————