public function member_history_rows() { $wc2_db_member = WC2_DB_Member::get_instance(); $wc2_order = WC2_DB_Order::get_instance(); $wc2_item = WC2_DB_Item::get_instance(); if (is_admin()) { $member_id = $wc2_db_member->get_member_id(); } else { if (wc2_is_login() && 0 != $_SESSION[WC2]['member']['ID']) { $member_id = $_SESSION[WC2]['member']['ID']; } else { return false; } } $member_history = $wc2_order->get_member_history($member_id); $colspan = wc2_is_membersystem_point() ? 9 : 7; $html = '<div class="history-area"> <table>'; if (!count($member_history)) { $html .= '<tr> <td>' . __('There is no your purchase history.', 'wc2') . '</td> </tr>'; } foreach ($member_history as $umhs) { $cart = $umhs['cart']; $history_member_head = '<tr> <th class="historyrow">' . __('Order number', 'wc2') . '</th> <th class="historyrow">' . __('Order status', 'wc2') . '</th> <th class="historyrow">' . __('Purchase date', 'wc2') . '</th> <th class="historyrow">' . __('Purchase amount', 'wc2') . '</th>'; if (wc2_is_membersystem_point()) { $history_member_head .= '<th class="historyrow">' . __('Used points', 'wc2') . '</th>'; } $history_member_head .= '<th class="historyrow">' . apply_filters('wc2_filter_discount_label', __('Discount', 'wc2'), $umhs) . '</th> <th class="historyrow">' . __('Shipping charges', 'wc2') . '</th> <th class="historyrow">' . apply_filters('wc2_filter_cod_label', __('COD fee', 'wc2')) . '</th> <th class="historyrow">' . __('Consumption tax', 'wc2') . '</th>'; if (wc2_is_membersystem_point()) { $history_member_head .= '<th class="historyrow">' . __('Acquired points', 'wc2') . '</th>'; } $history_member_head .= '</tr> <tr> <td class="rightnum"><a href="' . WC2_ADMIN_URL . '?page=wc2_order&action=edit&target=' . $umhs['ID'] . '">' . $umhs['dec_order_id'] . '</a></td> <td class="aleft">' . wc2_get_order_status_name($umhs['order_status']) . '</td> <td class="date">' . $umhs['order_date'] . '</td> <td class="rightnum">' . wc2_crform($umhs['item_total_price'] - $umhs['usedpoint'] + $umhs['discount'] + $umhs['shipping_charge'] + $umhs['cod_fee'] + $umhs['tax'], true, false) . '</td>'; if (wc2_is_membersystem_point()) { $history_member_head .= '<td class="rightnum">' . number_format($umhs['usedpoint']) . '</td>'; } $history_member_head .= '<td class="rightnum">' . wc2_crform($umhs['discount'], true, false) . '</td> <td class="rightnum">' . wc2_crform($umhs['shipping_charge'], true, false) . '</td> <td class="rightnum">' . wc2_crform($umhs['cod_fee'], true, false) . '</td> <td class="rightnum">' . wc2_crform($umhs['tax'], true, false) . '</td>'; if (wc2_is_membersystem_point()) { $history_member_head .= '<td class="rightnum">' . number_format($umhs['getpoint']) . '</td>'; } $history_member_head .= '</tr>'; $html .= apply_filters('wc2_filter_history_member_head', $history_member_head, $umhs); $html .= apply_filters('wc2_filter_member_history_header', NULL, $umhs); $html .= '<tr> <td class="retail" colspan="' . $colspan . '"> <table id="retail_table_' . $umhs['ID'] . '" class="retail">'; $history_cart_head = '<tr> <th scope="row" class="num">No.</th> <th class="thumbnail"> </th> <th>' . __('Items', 'wc2') . '</th> <th class="price ">' . __('Unit price', 'wc2') . '(' . wc2_crcode() . ')' . '</th> <th class="quantity">' . __('Quantity', 'wc2') . '</th> <th class="subtotal">' . __('Amount', 'wc2') . '(' . wc2_crcode() . ')' . '</th> </tr>'; $html .= apply_filters('wc2_filter_history_cart_head', $history_cart_head, $umhs); $i = 1; foreach ($cart as $cart_row) { $ordercart_id = $cart_row['cart_id']; $post_id = $cart_row['post_id']; $item_id = $cart_row['item_id']; $sku_id = $cart_row['sku_id']; $quantity = $cart_row['quantity']; $options = isset($cart_row['options']) ? $cart_row['options'] : ''; //$options = wc2_get_ordercart_meta_value( 'option', $ordercart_id ); //$options = wc2_get_ordercart_meta( 'option', $ordercart_id ); $item_name = $cart_row['item_name']; $item_code = $cart_row['item_code']; $sku_name = $cart_row['sku_name']; $sku_code = $cart_row['sku_code']; $cart_item_name = wc2_get_cart_item_name($item_name, $item_code, $sku_name, $sku_code); $skuPrice = $cart_row['price']; $pictid = (int) $wc2_item->get_mainpictid($item_code); $optstr = ''; if (is_array($options) && count($options) > 0) { $optstr = ''; foreach ($options as $key => $value) { if (!empty($key)) { $key = urldecode($key); $value = maybe_unserialize($value); if (is_array($value)) { $c = ''; $optstr .= esc_html($key) . ' : '; foreach ($value as $v) { $optstr .= $c . nl2br(esc_html(urldecode($v))); $c = ', '; } $optstr .= "<br />\n"; } else { $optstr .= esc_html($key) . ' : ' . nl2br(esc_html(urldecode($value))) . "<br />\n"; } } } $optstr = apply_filters('wc2_filter_option_history', $optstr, $options); } $optstr = apply_filters('wc2_filter_option_info_history', $optstr, $umhs, $cart_row, $i); $permalink = apply_filters('wc2_filter_link_item_history', get_permalink($post_id), $cart_row); $history_cart_row = '<tr> <td>' . $i . '</td> <td>'; if ($pictid) { $cart_thumbnail = '<a href="' . esc_url($permalink) . '">' . wp_get_attachment_image($pictid, array(60, 60), true) . '</a>'; } else { $cart_thumbnail = '<p>' . wc2_no_image() . '</p>'; } $history_cart_row .= apply_filters('wc2_filter_cart_thumbnail', $cart_thumbnail, $post_id, $pictid, $i, $cart_row); $history_cart_row .= '</td> <td class="aleft"><a href="' . esc_url($permalink) . '">' . esc_html($cart_item_name) . '<br />' . $optstr . '</a>' . apply_filters('wc2_filter_history_item_name', NULL, $umhs, $cart_row, $i) . '</td> <td class="rightnum">' . wc2_crform($skuPrice, true, false) . '</td> <td class="rightnum">' . number_format($cart_row['quantity']) . '</td> <td class="rightnum">' . wc2_crform($skuPrice * $cart_row['quantity'], true, false) . '</td> </tr>'; $materials = compact('cart_thumbnail', 'post_id', 'pictid', 'cart_item_name', 'optstr'); $html .= apply_filters('wc2_filter_history_cart_row', $history_cart_row, $umhs, $cart_row, $i, $materials); $i++; } $html .= '</table> </td> </tr>'; } $html .= '</table> </div>'; $html = apply_filters('wc2_filter_member_history_rows', $html, $member_id, $member_history, $colspan); return $html; }
public function admin_page_scripts() { if (!isset($this->plugin_screen_hook_suffix)) { return; } $screen = get_current_screen(); if ($this->plugin_screen_hook_suffix != $screen->id) { return; } $delivery = wc2_get_option('delivery'); $system_options = wc2_get_option('system'); $base_country = $system_options['base_country']; $delivery_method = isset($delivery['delivery_method']) ? $delivery['delivery_method'] : array(); //$shipping_charge = ( isset($delivery['shipping_charge']) ) ? $delivery['shipping_charge'] : array(); $shipping_charge = wc2_get_option('shipping_charge'); //$delivery_days = ( isset($delivery['delivery_days']) ) ? $delivery['delivery_days'] : array(); $delivery_days = wc2_get_option('delivery_days'); $target_market = isset($system_options['target_market']) && !empty($system_options['target_market']) ? $system_options['target_market'] : WC2_Funcs::get_local_target_market(); $prefs = array(); foreach ((array) $target_market as $tm) { $prefs[$tm] = $system_options['province'][$tm]; } ?> <script type="text/javascript"> jQuery(function($){ //tab $("#delivery-tabs").tabs(); if( $.fn.jquery < "1.10" ) { var $tabs = $("#delivery-tabs").tabs({ cookie: { expires: 1 } }); } else { $( "#delivery-tabs" ).tabs({ active: ($.cookie("delivery-tabs")) ? $.cookie("delivery-tabs") : 0 , activate: function( event, ui ){ $.cookie("delivery-tabs", $(this).tabs("option", "active")); } }); } $(document).on( "change", ".charge_text", function(){ check_money($(this)); }); $(document).on( "change", ".days_text", function(){ check_num($(this)); }); <?php if (!array_key_exists($base_country, (array) $target_market)) { $base_country = $target_market[0]; } $i = 0; ?> var target_market = []; <?php foreach ((array) $target_market as $tm) { ?> target_market[<?php echo $i; ?> ] = "<?php echo $tm; ?> "; <?php $i++; } ?> var base_country = "<?php echo $base_country; ?> "; var delivery_method = []; <?php for ($i = 0; $i < count((array) $delivery_method); $i++) { $lines = explode("\n", $delivery_method[$i]['time']); ?> delivery_method[<?php echo $i; ?> ] = []; delivery_method[<?php echo $i; ?> ]["id"] = <?php echo (int) $delivery_method[$i]['id']; ?> ; delivery_method[<?php echo $i; ?> ]["name"] = "<?php echo $delivery_method[$i]['name']; ?> "; delivery_method[<?php echo $i; ?> ]["charge"] = <?php echo (int) $delivery_method[$i]['charge']; ?> ; delivery_method[<?php echo $i; ?> ]["days"] = <?php echo (int) $delivery_method[$i]['days']; ?> ; sttr = ''; <?php foreach ((array) $lines as $line) { if (trim($line) != "") { ?> sttr += "<?php echo trim($line); ?> \n"; <?php } } ?> delivery_method[<?php echo $i; ?> ]["time"] = sttr; delivery_method[<?php echo $i; ?> ]["nocod"] = "<?php echo $delivery_method[$i]['nocod']; ?> "; delivery_method[<?php echo $i; ?> ]["intl"] = "<?php echo !empty($delivery_method[$i]['intl']) ? $delivery_method[$i]['intl'] : '0'; ?> "; delivery_method[<?php echo $i; ?> ]["limit_num"] = "<?php echo isset($delivery_method[$i]['limit_num']) ? $delivery_method[$i]['limit_num'] : ''; ?> "; <?php } ?> var pref = []; <?php foreach ((array) $target_market as $tm) { ?> pref["<?php echo $tm; ?> "] = []; <?php foreach ((array) $prefs[$tm] as $pref) { ?> pref["<?php echo $tm; ?> "].push("<?php echo $pref; ?> "); <?php } } ?> var shipping_charge = []; <?php for ($i = 0; $i < count((array) $shipping_charge); $i++) { ?> shipping_charge[<?php echo $i; ?> ] = []; shipping_charge[<?php echo $i; ?> ]["id"] = <?php echo (int) $shipping_charge[$i]['id']; ?> ; shipping_charge[<?php echo $i; ?> ]["name"] = "<?php echo $shipping_charge[$i]['name']; ?> "; <?php foreach ((array) $target_market as $tm) { ?> shipping_charge[<?php echo $i; ?> ]["<?php echo $tm; ?> "] = []; <?php foreach ((array) $prefs[$tm] as $pref) { ?> <?php if (isset($shipping_charge[$i][$tm][$pref])) { ?> shipping_charge[<?php echo $i; ?> ]["<?php echo $tm; ?> "]["<?php echo $pref; ?> "] = "<?php echo (double) $shipping_charge[$i][$tm][$pref]; ?> "; <?php } else { ?> shipping_charge[<?php echo $i; ?> ]["<?php echo $tm; ?> "]["<?php echo $pref; ?> "] = "0"; <?php } } } } ?> var delivery_days = []; <?php for ($i = 0; $i < count((array) $delivery_days); $i++) { ?> delivery_days[<?php echo $i; ?> ] = []; delivery_days[<?php echo $i; ?> ]["id"] = <?php echo (int) $delivery_days[$i]['id']; ?> ; delivery_days[<?php echo $i; ?> ]["name"] = "<?php echo $delivery_days[$i]['name']; ?> "; <?php foreach ((array) $target_market as $tm) { ?> delivery_days[<?php echo $i; ?> ]["<?php echo $tm; ?> "] = []; <?php foreach ((array) $prefs[$tm] as $pref) { ?> <?php if (isset($delivery_days[$i][$tm][$pref])) { ?> delivery_days[<?php echo $i; ?> ]["<?php echo $tm; ?> "]["<?php echo $pref; ?> "] = "<?php echo (int) $delivery_days[$i][$tm][$pref]; ?> "; <?php } else { ?> delivery_days[<?php echo $i; ?> ]["<?php echo $tm; ?> "]["<?php echo $pref; ?> "] = "0"; <?php } } } } ?> var selected_method = 0; function get_delivery_method_charge(selected){ var index = 0; for(var i=0; i<delivery_method.length; i++){ if(selected === delivery_method[i]["id"]){ index = i; } } if(undefined === delivery_method[index]){ return -1; }else{ return delivery_method[index]["charge"]; } } operation = { /*-------配送方法---------*/ disp_delivery_method :function (id){ selected_method = id; var index = false; for(var i=0; i<delivery_method.length; i++){ if(id === delivery_method[i]["id"]){ index = i; } } if(false === index){ selected = 0; }else{ selected = index; } if(delivery_method.length === 0) { $("#delivery_method_name").html('<input name="delivery_method_name" type="text" class="medium-text" value="" />'); $("#delivery_method_name2").html(""); $("#delivery_method_time").val(""); $("#delivery_method_button").html('<div class="submit"><input name="add_delivery_method" id="add_delivery_method" type="button" class="button" value="<?php _e('追加', 'wc2'); ?> " onclick="operation.add_delivery_method();" /></div>'); $("#delivery_method_nocod").html('<input name="delivery_method_nocod" type="checkbox" value="1" />'); $("#delivery_method_intl").html('<label title="0"><input name="delivery_method_intl" id="delivery_method_intl_0" type="radio" value="0" checked="checked" /><span><?php _e('国内便', 'wc2'); ?> </span></label><label title="1"><input name="delivery_method_intl" id="delivery_method_intl_1" type="radio" value="1" /><span><?php _e('国際便', 'wc2'); ?> </span></label>'); $("#delivery_method_item_limit_num").html('<input name="delivery_method_item_limit_num" type="text" class="medium-text right" value="" />'); operation.make_delivery_method_charge(-1); operation.make_delivery_method_days(-1); }else{ var name_select = '<select name="delivery_method_name_select" id="delivery_method_name_select" onchange="operation.onchange_delivery_select(this.selectedIndex);">'; for(var i=0; i<delivery_method.length; i++){ if(selected === i){ name_select += '<option value="'+delivery_method[i]["id"]+'" selected="selected">'+delivery_method[i]["id"]+' : '+delivery_method[i]["name"]+'</option>'; }else{ name_select += '<option value="'+delivery_method[i]["id"]+'">'+delivery_method[i]["id"]+' : '+delivery_method[i]["name"]+'</option>'; } } name_select += '</select>'; $("#delivery_method_name").html(name_select); $("#delivery_method_name2").html('<input name="delivery_method_name" type="text" class="medium-text" value="'+delivery_method[selected]["name"]+'" />'); $("#delivery_method_time").val(delivery_method[selected]["time"]); $("#delivery_method_button").html('<div class="submit"><input name="delete_delivery_method" id="delete_delivery_method" type="button" class="button" value="<?php _e('削除', 'wc2'); ?> " onclick="operation.delete_delivery_method();" />'+"\n"+'<input name="update_delivery_method" id="update_delivery_method" type="button" class="button" value="<?php _e('更新', 'wc2'); ?> " onclick="operation.update_delivery_method();" /></div>'); var checked_nocod = (delivery_method[selected]["nocod"] == "1") ? ' checked="checked"' : ""; $("#delivery_method_nocod").html('<input name="delivery_method_nocod" type="checkbox" value="1"'+checked_nocod+' />'); var checked_intl_0 = (delivery_method[selected]["intl"] == "0") ? ' checked="checked"' : ""; var checked_intl_1 = (delivery_method[selected]["intl"] == "1") ? ' checked="checked"' : ""; $("#delivery_method_intl").html('<label title="0"><input name="delivery_method_intl" id="delivery_method_intl_0" type="radio" value="0"'+checked_intl_0+' /><span><?php _e('国内便', 'wc2'); ?> </span></label><label title="1"><input name="delivery_method_intl" id="delivery_method_intl_1" type="radio" value="1"'+checked_intl_1+' /><span><?php _e('国際便', 'wc2'); ?> </span></label>'); $("#delivery_method_item_limit_num").html('<input name="delivery_method_item_limit_num" type="text" class="medium-text right" value="'+ delivery_method[selected]['limit_num'] +'" />'); operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); operation.make_delivery_method_days(get_delivery_method_days(selected_method)); } }, add_delivery_method : function() { if($('input[name="delivery_method_name"]').val() == "") return; $("#delivery_method_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); //var name = encodeURIComponent($("input[name='delivery_method_name']").val()); //var time = encodeURIComponent($("#delivery_method_time").val()); var name = $('input[name="delivery_method_name"]').val(); var time = $("#delivery_method_time").val(); var charge = $("#delivery_method_charge option:selected").val(); var days = $("#delivery_method_days option:selected").val(); var nocod = ($(':input[name="delivery_method_nocod"]').attr("checked")) ? "1" : "0"; var intl = $(':radio[name="delivery_method_intl"]:checked').val(); var limit_num = $('input[name="delivery_method_item_limit_num"]').val(); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "add_delivery_method", name: name, time: time, charge: charge, days: days, nocod: nocod, intl: intl, limit_num: limit_num, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; var name = val.name; var time = val.time; var charge = val.charge - 0; var days = val.days - 0; var nocod = val.nocod; var intl = val.intl; var limit_num = val.limit_num; var index = delivery_method.length; delivery_method[index] = []; delivery_method[index]["id"] = id; delivery_method[index]["name"] = name; delivery_method[index]["time"] = time; delivery_method[index]["charge"] = charge; delivery_method[index]["days"] = days; delivery_method[index]["nocod"] = nocod; delivery_method[index]["intl"] = intl; delivery_method[index]["limit_num"] = limit_num; //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_delivery_method(id); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#delivery_method_loading").html(""); }).fail( function( retVal ) { $("#delivery_method_loading").html(""); }); return false; }, update_delivery_method : function() { if($('input[name="delivery_method_name"]').val() == "") return; $("#delivery_method_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); var id = $("#delivery_method_name_select option:selected").val(); //var name = encodeURIComponent($("input[name='delivery_method_name']").val()); //var time = encodeURIComponent($("#delivery_method_time").val()); var name = $('input[name="delivery_method_name"]').val(); var time = $("#delivery_method_time").val(); var charge = $("#delivery_method_charge option:selected").val(); var days = $("#delivery_method_days option:selected").val(); var nocod = ($(':input[name="delivery_method_nocod"]').attr("checked")) ? "1" : "0"; var intl = $(':radio[name="delivery_method_intl"]:checked').val(); var limit_num = $('input[name="delivery_method_item_limit_num"]').val(); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "update_delivery_method", id: id, name: name, time: time, charge: charge, days: days, nocod: nocod, intl: intl, limit_num: limit_num, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; var name = val.name; var time = val.time; var charge = val.charge - 0; var days = val.days - 0; var nocod = val.nocod; var intl = val.intl; var limit_num = val.limit_num; for(var i=0; i<delivery_method.length; i++){ if(id === delivery_method[i]["id"]){ index = i; } } delivery_method[index]["name"] = name; delivery_method[index]["time"] = time; delivery_method[index]["charge"] = charge; delivery_method[index]["days"] = days; delivery_method[index]["nocod"] = nocod; delivery_method[index]["intl"] = intl; delivery_method[index]["limit_num"] = limit_num; //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_delivery_method(id); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#delivery_method_loading").html(""); }).fail( function( retVal ) { $("#delivery_method_loading").html(""); }); return false; }, delete_delivery_method : function() { var delname = $("#delivery_method_name_select option:selected").html(); if(!confirm(<?php _e("'配送方法「'+delname+'」を削除します。よろしいですか?'", 'wc2'); ?> )) return false; $("#delivery_method_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); var id = $("#delivery_method_name_select option:selected").val(); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "delete_delivery_method", id: id, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ) { var val = ret.data.value; var id = val.id - 0; for(var i=0; i<delivery_method.length; i++){ if(id === delivery_method[i]["id"]){ index = i; } } delivery_method.splice(index, 1); //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); $("#anibox").animate({"background-color":"#ECFFFF"},2000); operation.disp_delivery_method(0); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); $("#anibox").animate({"background-color":"#FFE6E6"},2000); } $("#delivery_method_loading").html(""); }).fail( function( retVal ) { $("#delivery_method_loading").html(""); }); return false; }, onchange_delivery_select : function(index) { var id = $("#delivery_method_name_select option:eq("+index+")").val()-0; operation.disp_delivery_method(id); }, make_delivery_method_charge : function(selected) { var option = '<select name="delivery_method_charge" id="delivery_method_charge">'; if(selected === -1){ option += '<option value="-1" selected="selected"><?php _e('送料を固定しない', 'wc2'); ?> </option>'; }else{ option += '<option value="-1"><?php _e('送料を固定しない', 'wc2'); ?> </option>'; } for(var i=0; i<shipping_charge.length; i++){ if(selected === shipping_charge[i]["id"]){ option += '<option value="'+shipping_charge[i]["id"]+'" selected="selected">'+shipping_charge[i]["name"]+'</option>'; }else{ option += '<option value="'+shipping_charge[i]["id"]+'">'+shipping_charge[i]["name"]+'</option>'; } } option += '</select>'; $("#delivery_method_charge_td").html(option); }, make_delivery_method_days : function(selected) { var option = '<select name="delivery_method_days" id="delivery_method_days">'; if(selected === -1){ option += '<option value="-1" selected="selected"><?php _e('配送希望日を利用しない', 'wc2'); ?> </option>'; }else{ option += '<option value="-1"><?php _e('配送希望日を利用しない', 'wc2'); ?> </option>'; } for(var i=0; i<delivery_days.length; i++){ if(selected === delivery_days[i]["id"]){ option += '<option value="'+delivery_days[i]["id"]+'" selected="selected">'+delivery_days[i]["name"]+'</option>'; }else{ option += '<option value="'+delivery_days[i]["id"]+'">'+delivery_days[i]["name"]+'</option>'; } } option += '</select>'; $("#delivery_method_days_td").html(option); }, moveup_delivery_method : function(selected) { var index = 0; for(var i=0; i<delivery_method.length; i++){ if(selected === delivery_method[i]["id"]){ index = i; } } if( 0 === index ) return; $("#delivery_method_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "moveup_delivery_method", id: selected, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var selected = ret.data.selected; var ct = delivery_method.length; for(var i=0; i<ct; i++){ delivery_method[i]["id"] = val[i].id - 0; delivery_method[i]["name"] = val[i].name; delivery_method[i]["time"] = val[i].time; delivery_method[i]["charge"] = val[i].charge - 0; delivery_method[i]["days"] = val[i].days - 0; delivery_method[i]["nocod"] = val[i].nocod; delivery_method[i]["intl"] = val[i].intl; delivery_method[i]["limit_num"] = val[i].limit_num; } //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_delivery_method(selected); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#delivery_method_loading").html(""); }).fail( function( retVal ) { $("#delivery_method_loading").html(""); }); return false; }, movedown_delivery_method : function(selected) { var index = 0; var ct = delivery_method.length; for(var i=0; i<ct; i++){ if(selected === delivery_method[i]["id"]){ index = i; } } if( index >= ct-1 ) return; $("#delivery_method_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "movedown_delivery_method", id: selected, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success){ var val = ret.data.value; var selected = ret.data.selected; var ct = delivery_method.length; for(var i=0; i<ct; i++){ delivery_method[i]["id"] = val[i].id - 0; delivery_method[i]["name"] = val[i].name; delivery_method[i]["time"] = val[i].time; delivery_method[i]["charge"] = val[i].charge - 0; delivery_method[i]["days"] = val[i].days - 0; delivery_method[i]["nocod"] = val[i].nocod; delivery_method[i]["intl"] = val[i].intl; delivery_method[i]["limit_num"] = val[i].limit_num; } //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_delivery_method(selected); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#delivery_method_loading").html(""); }).fail( function( retVal ) { $("#delivery_method_loading").html(""); }); return false; }, /*--------送料---------*/ disp_shipping_charge : function (id){ var valuehtml = ""; if(shipping_charge.length === 0) { for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; valuehtml += '<div id="shipping_charge_'+tm+'">'; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; valuehtml += '<span class="shipping_charge_label">'+p+'</span><input type="text" name="shipping_charge_value_'+tm+'['+p+']" value="" class="charge_text medium-text right" /><?php echo wc2_crcode(); ?> <br />'; } valuehtml += '</div>'; } $("#shipping_charge_name").html('<input name="shipping_charge_name" type="text" class="medium-text" value="" />'); $("#shipping_charge_name2").html(""); $("#shipping_charge_value").html(valuehtml); $("#shipping_charge_button").html('<div class="submit"><input name="add_shipping_charge" id="add_shipping_charge" type="button" class="button" value="<?php _e('追加', 'wc2'); ?> " onclick="operation.add_shipping_charge();" /></div>'); }else{ var selected = 0; var name_select = '<select name="shipping_charge_name_select" id="shipping_charge_name_select" onchange="operation.onchange_shipping_charge(this.selectedIndex);">'; for(var i=0; i<shipping_charge.length; i++){ if(shipping_charge[i]["id"] === id){ selected = i; name_select += '<option value="'+shipping_charge[i]["id"]+'" selected="selected">'+shipping_charge[i]["name"]+'</option>'; }else{ name_select += '<option value="'+shipping_charge[i]["id"]+'">'+shipping_charge[i]["name"]+'</option>'; } } name_select += '</select>'; var value = ""; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; valuehtml += '<div id="shipping_charge_'+tm+'">'; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; value = ( shipping_charge[selected][tm][p] == undefined ) ? '' : shipping_charge[selected][tm][p]; valuehtml += '<span class="shipping_charge_label">'+p+'</span><input type="text" name="shipping_charge_value_'+tm+'['+p+']" value="'+value+'" class="charge_text medium-text right" /><?php echo wc2_crcode(); ?> <br />'; } valuehtml += '</div>'; } $("#shipping_charge_name").html(name_select); $("#shipping_charge_name2").html('<input name="shipping_charge_name" type="text" class="medium-text" value="'+shipping_charge[selected]['name']+'" />'); $("#shipping_charge_value").html(valuehtml); $("#shipping_charge_button").html('<div class="submit"><input name="delete_shipping_charge" id="delete_shipping_charge" type="button" class="button" value="<?php _e('削除', 'wc2'); ?> " onclick="operation.delete_shipping_charge();" />'+"\n"+'<input name="update_shipping_charge" id="update_shipping_charge" type="button" class="button" value="<?php _e('更新', 'wc2'); ?> " onclick="operation.update_shipping_charge();" /></div>'); } $(document).on( "change", ".charge_text", function(){ check_money($(this)); }); var country = $("#shipping_charge_country option:selected").val(); for( var i = 0; i < target_market.length; i++ ) { if( country == target_market[i] ) { $("#shipping_charge_"+target_market[i]).css("display",""); } else { $("#shipping_charge_"+target_market[i]).css("display","none"); } } }, add_shipping_charge : function() { var error = 0; if($('input[name="shipping_charge_name"]').val() == "") { error++; $('input[name="shipping_charge_name"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; var value = $('input[name="shipping_charge_value_'+tm+'['+p+']"]').val(); if( "" == value || !WC2Util.checkMoney(value) ) { error++; $('input[name="shipping_charge_value_'+tm+'['+p+']"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } } } if( 0 < error ) { alert("<?php _e('データに不備があります。', 'wc2'); ?> "); return false; } $("#shipping_charge_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); //var name = encodeURIComponent($("input[name='shipping_charge_name']").val()); var name = $('input[name="shipping_charge_name"]').val(); var query = ""; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { query += '&value_'+tm+'='+$('input[name="shipping_charge_value_'+tm+'['+pref[tm][i]+']"]').val(); } } query = query.slice(1); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "add_shipping_charge", name: name, query: query, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; var name = val.name; var index = shipping_charge.length; shipping_charge[index] = []; shipping_charge[index]["id"] = id; shipping_charge[index]["name"] = name; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; shipping_charge[index][tm] = []; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; shipping_charge[index][tm][p] = val[tm][p]; } } //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_shipping_charge(id); operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#shipping_charge_loading").html(""); }).fail( function( retVal ) { $("#shipping_charge_loading").html(""); }); return false; }, update_shipping_charge : function() { var error = 0; if($('input[name="shipping_charge_name"]').val() == "") { error++; $('input[name="shipping_charge_name"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; var value = $('input[name="shipping_charge_value_'+tm+'['+p+']"]').val(); if( "" == value || !WC2Util.checkMoney(value) ) { error++; $('input[name="shipping_charge_value_'+tm+'['+p+']"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } } } if( 0 < error ) { alert("<?php _e('データに不備があります。', 'wc2'); ?> "); return false; } $("#shipping_charge_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); var id = $("#shipping_charge_name_select option:selected").val(); //var name = encodeURIComponent($("input[name='shipping_charge_name']").val()); var name = $('input[name="shipping_charge_name"]').val(); var query = ""; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ){ query += '&value_'+tm+'='+$('input[name="shipping_charge_value_'+tm+'['+pref[tm][i]+']"]').val(); } } query = query.slice(1); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "update_shipping_charge", id: id, name: name, query: query, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; var name = val.name; for(var i=0; i<shipping_charge.length; i++){ if(id === shipping_charge[i]["id"]){ index = i; } } shipping_charge[index]["name"] = name; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; shipping_charge[index][tm][p] = val[tm][p]; } } //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_shipping_charge(id); operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#shipping_charge_loading").html(""); }).fail( function( retVal ) { $("#shipping_charge_loading").html(""); }); return false; }, delete_shipping_charge : function() { var delname = $("#shipping_charge_name_select option:selected").html(); if(!confirm(<?php _e("'送料「'+delname+'」を削除します。よろしいですか?'", 'wc2'); ?> )) return false; $("#shipping_charge_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); var id = $("#shipping_charge_name_select option:selected").val(); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "delete_shipping_charge", id: id, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; for(var i=0; i<shipping_charge.length; i++){ if(id === shipping_charge[i]["id"]){ index = i; } } shipping_charge.splice(index, 1); //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_shipping_charge(0); operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); }else{ $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#shipping_charge_loading").html(""); }).fail( function( retVal ) { $("#shipping_charge_loading").html(""); }); return false; }, onchange_shipping_charge : function(index) { var id = $("#shipping_charge_name_select option:eq("+index+")").val()-0; operation.disp_shipping_charge(id); }, allCharge : function () { var charge = $("#allcharge").val(); if( charge == "" ) return; if( confirm(<?php echo sprintf(__("'各都道府県の送料を%s' + charge + 'に一括設定します。よろしいですか?'", 'wc2'), esc_js(WC2_Funcs::get_crsymbol('js'))); ?> ) ){ var country = $("#shipping_charge_country option:selected").val(); for( var i = 0; i < pref[country].length; i++ ) { $('input[name="shipping_charge_value_'+country+'['+pref[country][i]+']"]').val(charge); } $("#allcharge").val(""); } }, disp_delivery_days :function (id){ var valuehtml = ''; if(delivery_days.length === 0) { for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; valuehtml += '<div id="delivery_days_'+tm+'">'; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; valuehtml += '<span class="delivery_days_label">'+p+'</span><input type="text" name="delivery_days_value_'+tm+'['+p+']" value="" class="days_text small-text right" /><?php _e('日', 'wc2'); ?> <br />'; } valuehtml += "</div>"; } $("#delivery_days_name").html('<input name="delivery_days_name" type="text" class="medium-text" value="" />'); $("#delivery_days_name2").html(""); $("#delivery_days_value").html(valuehtml); $("#delivery_days_button").html('<div class="submit"><input name="add_delivery_days" id="add_delivery_days" type="button" class="button" value="<?php _e('追加', 'wc2'); ?> " onclick="operation.add_delivery_days();" /></div>'); }else{ var selected = 0; var name_select = '<select name="delivery_days_name_select" id="delivery_days_name_select" onchange="operation.onchange_delivery_days(this.selectedIndex);">'; for(var i=0; i<delivery_days.length; i++){ if(delivery_days[i]["id"] === id){ selected = i; name_select += '<option value="'+delivery_days[i]["id"]+'" selected="selected">'+delivery_days[i]["name"]+'</option>'; }else{ name_select += '<option value="'+delivery_days[i]["id"]+'">'+delivery_days[i]["name"]+'</option>'; } } name_select += '</select>'; var value = ""; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; valuehtml += '<div id="delivery_days_'+tm+'">'; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; value = ( delivery_days[selected][tm][p] == undefined ) ? '' : delivery_days[selected][tm][p]; valuehtml += '<span class="delivery_days_label">'+p+'</span><input type="text" name="delivery_days_value_'+tm+'['+p+']" value="'+value+'" class="days_text small-text right" /><?php _e('日', 'wc2'); ?> <br />'; } valuehtml += '</div>'; } $("#delivery_days_name").html(name_select); $("#delivery_days_name2").html('<input name="delivery_days_name" type="text" class="medium-text" value="'+delivery_days[selected]['name']+'" />'); $("#delivery_days_value").html(valuehtml); $("#delivery_days_button").html('<div class="submit"><input name="delete_delivery_days" id="delete_delivery_days" type="button" class="button" value="<?php _e('削除', 'wc2'); ?> " onclick="operation.delete_delivery_days();" />'+"\n"+'<input name="update_delivery_days" id="update_delivery_days" type="button" class="button" value="<?php _e('更新', 'wc2'); ?> " onclick="operation.update_delivery_days();" /></div>'); } $(document).on( "change", ".days_text", function(){ check_num($(this)); }); var country = $("#delivery_days_country option:selected").val(); for( var i = 0; i < target_market.length; i++ ) { if( country == target_market[i] ) { $("#delivery_days_"+target_market[i]).css("display",""); } else { $("#delivery_days_"+target_market[i]).css("display","none"); } } }, add_delivery_days : function() { var error = 0; if($('input[name="delivery_days_name"]').val() == "") { error++; $('input[name="delivery_days_name"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; var value = $('input[name="delivery_days_value_'+tm+'['+p+']"]').val(); if( "" == value || !WC2Util.checkNum(value) ) { error++; $('input[name="delivery_days_value_'+tm+'['+p+']"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } } } if( 0 < error ) { alert("<?php _e('データに不備があります。', 'wc2'); ?> "); return false; } $("#delivery_days_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); var name = $('input[name="delivery_days_name"]').val(); var query = ''; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { query += '&value_'+tm+'='+$('input[name="delivery_days_value_'+tm+'['+pref[tm][i]+']"]').val(); } } query = query.slice(1); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "add_delivery_days", name: name, query: query, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; var name = val.name; var index = delivery_days.length; delivery_days[index] = []; delivery_days[index]["id"] = id; delivery_days[index]["name"] = name; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; delivery_days[index][tm] = []; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; delivery_days[index][tm][p] = val[tm][p]; } } //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_delivery_days(id); operation.make_delivery_method_days(get_delivery_method_days(selected_method)); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#delivery_days_loading").html(""); }).fail( function( retVal ) { $("#delivery_days_loading").html(""); }); return false; }, update_delivery_days : function() { var error = 0; if($('input[name="delivery_days_name"]').val() == "") { error++; $('input[name="delivery_days_name"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; var value = $('input[name="delivery_days_value_'+tm+'['+p+']"]').val(); if( "" == value || !WC2Util.checkNum(value) ) { error++; $('input[name="delivery_days_value_'+tm+'['+p+']"]').css({'background-color': '#FFA'}).click(function() { $(this).css({'background-color': '#FFF'}); }); } } } if( 0 < error ) { alert("<?php _e('データに不備があります。', 'wc2'); ?> "); return false; } $("#delivery_days_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); var id = $("#delivery_days_name_select option:selected").val(); var name = $('input[name="delivery_days_name"]').val(); var query = ""; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ){ query += '&value_'+tm+'='+$('input[name="delivery_days_value_'+tm+'['+pref[tm][i]+']"]').val(); } } query = query.slice(1); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "update_delivery_days", id: id, name: name, query: query, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; var name = val.name; for(var i=0; i<delivery_days.length; i++){ if(id === delivery_days[i]["id"]){ index = i; } } delivery_days[index]["name"] = name; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; delivery_days[index][tm][p] = val[tm][p]; } } //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_delivery_days(id); operation.make_delivery_method_days(get_delivery_method_days(selected_method)); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#delivery_days_loading").html(""); }).fail( function( retVal ) { $("#delivery_days_loading").html(""); }); return false; }, delete_delivery_days : function() { var delname = $("#delivery_days_name_select option:selected").html(); if(!confirm(<?php _e("'配達日数設定「' + delname + '」を削除してもよろしいですか?'", 'wc2'); ?> )) return false; $("#delivery_days_loading").html('<img src="'+WC2L10n.loading_gif+'" />'); var id = $("#delivery_days_name_select option:selected").val(); $.ajax({ url: ajaxurl, type: "POST", dataType: "JSON", scriptCharset: "UTF-8", processData: true, cache: false, data: { action: "delivery_ajax", mode: "delete_delivery_days", id: id, wc2_nonce: $("#wc2_nonce").val() } }).done( function( ret, dataType ) { var mes = ret.data.message; if( ret.success ){ var val = ret.data.value; var id = val.id - 0; for(var i=0; i<delivery_days.length; i++){ if(id === delivery_days[i]["id"]){ index = i; } } delivery_days.splice(index, 1); //success_message $("#aniboxStatus").attr("class","success"); $("#info_image").attr("src", WC2L10n.success_info); $("#info_message").html(mes); operation.disp_delivery_days(0); operation.make_delivery_method_days(get_delivery_method_days(selected_method)); }else{ //error_message $("#aniboxStatus").attr("class","error"); $("#info_image").attr("src", WC2L10n.error_info); $("#info_message").html(mes); } $("#delivery_days_loading").html(""); }).fail( function( retVal ) { $("#delivery_days_loading").html(""); }); return false; }, onchange_delivery_days : function(index) { var id = $("#delivery_days_name_select option:eq("+index+")").val()-0; operation.disp_delivery_days(id); }, allDeliveryDays : function () { var days = $("#all_delivery_days").val(); if( days == "" ) return; if( confirm(<?php _e("'配達日数を全て ' + days + ' 日に変更してもよろしいですか?'", 'wc2'); ?> ) ){ var country = $("#delivery_days_country option:selected").val(); for( var i = 0; i < pref[country].length; i++ ) { $('input[name="delivery_days_value_'+country+'['+pref[country][i]+']"]').val(days); } $("#all_delivery_days").val(""); } } }; $("#delivery_method_charge").click(function () { if(shipping_charge.length == 0){ alert("<?php _e('送料を設定してください。', 'wc2'); ?> "); } }); function get_delivery_method_days(selected){ var index = 0; for(var i=0; i<delivery_method.length; i++){ if(selected === delivery_method[i]["id"]){ index = i; } } if(undefined === delivery_method[index]){ return -1; }else{ return delivery_method[index]["days"]; } } $("#delivery_method_days").click(function () { if(delivery_days.length == 0){ alert("<?php _e('Please set the delivery days', 'wc2'); ?> "); } }); $("#new_delivery_method_action").click(function () { if(delivery_method.length === 0) return false; $("#delivery_method_name").html('<input name="delivery_method_name" type="text" class="medium-text" value="" />'); $("#delivery_method_name2").html(""); $("#delivery_method_time").val(""); $("#delivery_method_button").html('<input name="cancel_delivery_method" id="cancel_delivery_method" type="button" class="button" value="<?php _e('キャンセル', 'wc2'); ?> " onclick="operation.disp_delivery_method(0);" /><input name="add_delivery_method" id="add_delivery_method" type="button" class="button" value="<?php _e('追加', 'wc2'); ?> " onclick="operation.add_delivery_method();" />'); $("#delivery_method_nocod").html('<input name="delivery_method_nocod" type="checkbox" value="1" />'); $("#delivery_method_intl").html('<label title="0"><input name="delivery_method_intl" id="delivery_method_intl_0" type="radio" value="0" checked="checked" /><span><?php _e('国内便', 'wc2'); ?> </span></label><input name="delivery_method_intl" id="delivery_method_intl_1" type="radio" value="1" /><label title="1"><span><?php _e('国際便', 'wc2'); ?> </span></label>'); $("#delivery_method_item_limit_num").html('<input name="delivery_method_item_limit_num" type="text" class="medium-text right" value="" />'); $('input[name="delivery_method_name"]').focus().select(); operation.make_delivery_method_charge(-1); operation.make_delivery_method_days(-1); }); $("#moveup_action").click(function () { var id = $("#delivery_method_name_select option:selected").val()-0; operation.moveup_delivery_method(id); operation.disp_delivery_method(id); }); $("#movedown_action").click(function () { var id = $("#delivery_method_name_select option:selected").val()-0; operation.movedown_delivery_method(id); operation.disp_delivery_method(id); }); $("#new_shipping_charge_action").click(function () { var valuehtml = ""; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; valuehtml += '<div id="shipping_charge_'+tm+'">'; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; valuehtml += '<span class="shipping_charge_label">'+p+'</span><input type="text" name="shipping_charge_value_'+tm+'['+p+']" value="" class="charge_text medium-text right" /><?php echo wc2_crcode(); ?> <br />'; } valuehtml += '</div>'; } $("#shipping_charge_country").val(base_country); $("#shipping_charge_name").html('<input name="shipping_charge_name" type="text" class="medium-text" value="" />'); $("#shipping_charge_name2").html(""); $("#shipping_charge_value").html(valuehtml); $("#shipping_charge_button").html('<input name="cancel_shipping_charge" id="cancel_shipping_charge" type="button" class="button" value="<?php _e('キャンセル', 'wc2'); ?> " onclick="operation.disp_shipping_charge(0);" /><input name="add_shipping_charge" id="add_shipping_charge" type="button" class="button" value="<?php _e('追加', 'wc2'); ?> " onclick="operation.add_shipping_charge();" />'); $('input[name="shipping_charge_name"]').focus().select(); $(document).on( "change", ".charge_text", function(){ check_money($(this)); }); for( var i = 0; i < target_market.length; i++ ) { if( base_country == target_market[i] ) { $("#shipping_charge_"+target_market[i]).css("display",""); } else { $("#shipping_charge_"+target_market[i]).css("display","none"); } } }); $("#new_delivery_days_action").click(function () { var valuehtml = ""; for( var j = 0; j < target_market.length; j++ ) { var tm = target_market[j]; valuehtml += '<div id="delivery_days_'+tm+'">'; for( var i = 0; i < pref[tm].length; i++ ) { var p = pref[tm][i]; valuehtml += '<span class="delivery_days_label">'+p+'</span><input type="text" name="delivery_days_value_'+tm+'['+p+']" value="" class="days_text small-text right" /><?php _e('日', 'wc2'); ?> <br />'; } valuehtml += '</div>'; } $("#delivery_days_country").val(base_country); $("#delivery_days_name").html('<input name="delivery_days_name" type="text" class="medium-text" value="" />'); $("#delivery_days_name2").html(""); $("#delivery_days_value").html(valuehtml); $("#delivery_days_button").html('<input name="cancel_delivery_days" id="cancel_delivery_days" type="button" class="button" value="<?php _e('キャンセル', 'wc2'); ?> " onclick="operation.disp_delivery_days(0);" /><input name="add_delivery_days" id="add_delivery_days" type="button" class="button" value="<?php _e('追加', 'wc2'); ?> " onclick="operation.add_delivery_days();" />'); $('input[name="delivery_days_name"]').focus().select(); $(document).on( "change", ".days_text", function(){ check_num($(this)); }); for( var i = 0; i < target_market.length; i++ ) { if( base_country == target_market[i] ) { $("#delivery_days_"+target_market[i]).css("display",""); } else { $("#delivery_days_"+target_market[i]).css("display","none"); } } }); $("#shipping_charge_country").change(function () { var country = $("#shipping_charge_country option:selected").val(); for( var i = 0; i < target_market.length; i++ ) { if( country == target_market[i] ) { $("#shipping_charge_"+target_market[i]).css("display",""); } else { $("#shipping_charge_"+target_market[i]).css("display","none"); } } }); $("#delivery_days_country").change(function () { var country = $("#delivery_days_country option:selected").val(); for( var i = 0; i < target_market.length; i++ ) { if( country == target_market[i] ) { $("#delivery_days_"+target_market[i]).css("display",""); } else { $("#delivery_days_"+target_market[i]).css("display","none"); } } }); function check_num( obj ) { if( !WC2Util.checkNum( obj.val()) ) { alert("数値で入力してください。"); obj.focus(); return false; } return true; } function check_money( obj ) { if( !WC2Util.checkMoney(obj.val()) ) { alert("数値で入力してください。"); obj.focus(); return false; } return true; } <?php do_action('wc2_action_admin_delivery_scripts'); ?> }); jQuery(document).ready(function($) { operation.disp_delivery_method(-1); operation.disp_shipping_charge(-1); operation.disp_delivery_days(-1); $("#allbutton").click( function() { operation.allCharge(); }); $("#allbutton_delivery_days").click( function() { operation.allDeliveryDays(); }); }); </script> <?php }
?> </select> </td> </tr> <tr> <th><?php _e('Shipping charges', 'wc2'); ?> </th> <td> <input id="allbutton" type="button" class="allbutton button" value="<?php _e('一括設定', 'wc2'); ?> " /> <input name="allcharge" id="allcharge" type="text" class="charge_text medium-text right" /><?php echo wc2_crcode(); ?> </td> </tr> <tr> <th></th> <td><div id="shipping_charge_value"></div></td> </tr> </table> </div> </div> </div> </div> <div id="delivery_page_setting_4"> <div class="postbox"> <h3 class="hndle"><span><?php
function wc2_crcode_e(){ echo wc2_crcode(); }
public function pdfSetFooter($pdf, $data) { global $wc2; $wc2_options = wc2_get_option(); $font = $this->font; $border = 0; list($fontsize, $lineheight, $linetop) = $this->set_font_size(9); $pdf->SetFont($font, '', $fontsize); // Body label $pdf->SetXY(15.5, 94.90000000000001); $pdf->MultiCell(87.8, $lineheight, $this->conv_enc(__('Item name', 'wc2')), $border, 'C'); $pdf->SetXY(103.7, 94.90000000000001); $pdf->MultiCell(11.4, $lineheight, $this->conv_enc(__('Quantity', 'wc2')), $border, 'C'); $pdf->SetXY(115.8, 94.90000000000001); $pdf->MultiCell(11.0, $lineheight, $this->conv_enc(__('Unit', 'wc2')), $border, 'C'); $pdf->SetXY(127.2, 94.90000000000001); $pdf->MultiCell(15.0, $lineheight, $this->conv_enc(__('Price', 'wc2')), $border, 'C'); $pdf->SetXY(142.9, 94.90000000000001); $pdf->MultiCell(22.4, $lineheight, $this->conv_enc(__('Amount', 'wc2') . '(' . __(wc2_crcode(), 'wc2') . ')'), $border, 'C'); // Footer label $labeldata = array('order_condition' => $data['order_condition'], 'order_item_total_price' => $data['item_total_price'], 'order_discount' => $data['discount'], 'order_shipping_charge' => $data['shipping_charge'], 'order_cod_fee' => $data['cod_fee']); $pdf->SetXY(104.3, 198.8); $pdf->MultiCell(37.7, $lineheight, $this->conv_enc(__('Total amount of items', 'wc2')), $border, 'C'); $pdf->SetXY(104.3, 204.8); $pdf->MultiCell(37.7, $lineheight, $this->conv_enc(apply_filters('wc2_filter_discount_label', __('Discount', 'wc2'), $data)), $border, 'C'); if ('products' == wc2_get_tax_target()) { $data_1 = apply_filters('wc2_filter_tax_label', wc2_tax_label($labeldata)); $data_2 = apply_filters('wc2_filter_shipping_label', __('Shipping charges', 'wc2')); $data_3 = apply_filters('wc2_filter_cod_label', __('COD fee', 'wc2')); } else { $data_1 = apply_filters('wc2_filter_shipping_label', __('Shipping charges', 'wc2')); $data_2 = apply_filters('wc2_filter_cod_label', __('COD fee', 'wc2')); $data_3 = apply_filters('wc2_filter_tax_label', wc2_tax_label($labeldata)); } $pdf->SetXY(104.3, 210.8); $pdf->MultiCell(37.7, $lineheight, $this->conv_enc($data_1), $border, 'C'); $pdf->SetXY(104.3, 216.7); $pdf->MultiCell(37.7, $lineheight, $this->conv_enc($data_2), $border, 'C'); $pdf->SetXY(104.3, 222.7); $pdf->MultiCell(37.7, $lineheight, $this->conv_enc($data_3), $border, 'C'); if (wc2_is_membersystem_point()) { $pdf->SetXY(104.3, 228.6); $pdf->MultiCell(37.7, $lineheight, $this->conv_enc(apply_filters('wc2_filter_point_label', __('Used points', 'wc2'))), $border, 'C'); $pdf->SetXY(104.3, 235.8); $pdf->MultiCell(37.77, $lineheight, $this->conv_enc(__('Total Amount', 'wc2')), $border, 'C'); } else { $pdf->SetXY(104.3, 235.8); $pdf->MultiCell(37.77, $lineheight * 2, $this->conv_enc(__('Total Amount', 'wc2')), $border, 'C'); } list($fontsize, $lineheight, $linetop) = $this->set_font_size(8); $pdf->SetFont($font, '', $fontsize); // Footer value $payment = wc2_get_payment($data['payment_method']); $transfers = apply_filters('wc2_filter_pdf_transfer', array('BT'), $data); if ('invoice' == $_REQUEST['type'] && in_array($payment['settlement'], $transfers)) { $transferee = __('Transfer', 'wc2') . " : \r\n"; $transferee .= wc2_get_option('transferee_info') . "\r\n"; $note_text = apply_filters('wc2_filter_mail_transferee', $transferee, $data, 'pdf', $payment); } else { $note_text = $data['note']; } $pdf->SetXY(16.1, 198.8); $pdf->MultiCell(86.59999999999999, $lineheight, $this->conv_enc(apply_filters('wc2_filter_pdf_note', $note_text, $data, $_REQUEST['type'])), $border, 'J'); list($fontsize, $lineheight, $linetop) = $this->set_font_size(9); $pdf->SetFont($font, '', $fontsize); $pdf->SetXY(142.9, 198.8); $total_price = $data['item_total_price'] - $data['usedpoint'] + $data['discount'] + $data['shipping_charge'] + $data['cod_fee'] + $data['tax']; $pdf->MultiCell(22.6, $lineheight, wc2_get_currency($data['item_total_price']), $border, 'R'); $materials = array('total_price' => $data['item_total_price'], 'discount' => $data['discount'], 'shipping_charge' => $data['shipping_charge'], 'cod_fee' => $data['cod_fee']); if ('include' == $wc2_options['general']['tax_mode']) { $tax = '(' . wc2_internal_tax($materials) . ')'; } else { $tax = wc2_get_currency($data['tax']); } if ('products' == wc2_get_tax_target()) { $datav_1 = apply_filters('wc2_filter_tax_value', $tax, $data); $datav_2 = apply_filters('wc2_filter_shipping_value', wc2_get_currency($data['shipping_charge']), $data); $datav_3 = apply_filters('wc2_filter_cod_value', wc2_get_currency($data['cod_fee']), $data); } else { $datav_1 = apply_filters('wc2_filter_shipping_value', wc2_get_currency($data['shipping_charge']), $data); $datav_2 = apply_filters('wc2_filter_cod_value', wc2_get_currency($data['cod_fee']), $data); $datav_3 = apply_filters('wc2_filter_tax_value', $tax, $data); } $pdf->SetXY(142.9, 204.8); $pdf->MultiCell(22.6, $lineheight, $this->conv_enc(apply_filters('wc2_filter_discount_value', wc2_get_currency($data['discount']), $data)), $border, 'R'); $pdf->SetXY(142.9, 210.8); $pdf->MultiCell(22.6, $lineheight, $this->conv_enc($datav_1), $border, 'R'); $pdf->SetXY(142.9, 216.7); $pdf->MultiCell(22.6, $lineheight, $this->conv_enc($datav_2), $border, 'R'); $pdf->SetXY(142.9, 222.7); $pdf->MultiCell(22.6, $lineheight, $this->conv_enc($datav_3), $border, 'R'); if (wc2_is_membersystem_point()) { $pdf->SetXY(142.9, 228.6); $pdf->MultiCell(22.6, $lineheight, $this->conv_enc(apply_filters('wc2_filter_point_value', wc2_get_currency($data['usedpoint']), $data)), $border, 'R'); $pdf->SetXY(142.9, 235.8); $pdf->MultiCell(22.67, $lineheight, $this->conv_enc(wc2_get_currency($total_price)), $border, 'R'); } else { $pdf->SetXY(142.9, 235.8); $pdf->MultiCell(22.67, $lineheight, $this->conv_enc(wc2_get_currency($total_price)), $border, 'R'); } do_action('wc2_action_order_print_footer', $pdf, $data); }
public function payment_list_row($data, $id) { if (empty($data)) { return; } $settlement_types = wc2_get_option('settlement_types'); $name = isset($data['name']) ? esc_attr($data['name']) : ''; $explanation = isset($data['explanation']) ? esc_attr($data['explanation']) : ''; $settlement = $data['settlement']; $sort = isset($data['sort']) ? (int) $data['sort'] : 1; $use = isset($data['use']) ? $data['use'] : 'activate'; $check_activate = $use != 'deactivate' ? ' checked="checked"' : ''; $check_deactivate = $use == 'deactivate' ? ' checked="checked"' : ''; $payment_charge = isset($data['charge']) ? $data['charge'] : 'none'; $display = $payment_charge == 'price' ? '' : ' style="display:none;"'; $charge_price = isset($data['charge_price']) ? (int) $data['charge_price'] : 0; ob_start(); ?> <tr id="payment-<?php echo $id; ?> "> <th class="hdl"> </th> <td class="payment-name"> <div><input type="text" id="payment-name-<?php echo $id; ?> " class="medium-text" value="<?php echo $name; ?> " /></div> <div> <label title="activate"><input type="radio" name="payment_use_<?php echo $id; ?> " id="payment-use-activate-<?php echo $id; ?> " value="activate"<?php echo $check_activate; ?> /><span><?php _e('使用', 'wc2'); ?> </span></label> <label title="deactivate"><input type="radio" name="payment_use_<?php echo $id; ?> " id="payment-use-deactivate-<?php echo $id; ?> " value="deactivate"<?php echo $check_deactivate; ?> /><span><?php _e('停止', 'wc2'); ?> </span></label> </div> <div id="payment-submit-<?php echo $id; ?> " class="submit"> <input type="button" id="delete-payment-<?php echo $id; ?> " class="button action" value="<?php esc_attr_e(__('Delete')); ?> " /> <input type="button" id="update-payment-<?php echo $id; ?> " class="button action" value="<?php esc_attr_e(__('Update')); ?> " /> <input type="hidden" id="payment-sort-<?php echo $id; ?> " value="<?php echo $sort; ?> " /> </div> <div id="payment-loading-<?php echo $id; ?> " class="loading"></div> </td> <td class="payment-explanation"><textarea id="payment-explanation-<?php echo $id; ?> " class="regular-text"><?php echo $explanation; ?> </textarea></td> <td class="payment-settlement"> <select id="payment-settlement-<?php echo $id; ?> "> <option value="<?php echo WC2_UNSELECTED; ?> "><?php _e('-- Select --', 'wc2'); ?> </option> <?php foreach ($settlement_types as $key => $type) { ?> <?php $selected = $key == $settlement ? ' selected="selected"' : ''; ?> <option value="<?php esc_attr_e($key); ?> "<?php echo $selected; ?> ><?php esc_html_e($type); ?> </option> <?php } ?> </select> </td> <td class="payment-charge"> <select class="payment-charge-select" id="payment-charge-<?php echo $id; ?> "> <option value="none"<?php if ($payment_charge == 'none') { echo ' selected="selected"'; } ?> ><?php _e('手数料なし', 'wc2'); ?> </option> <option value="cod"<?php if ($payment_charge == 'cod') { echo ' selected="selected"'; } ?> ><?php _e('代引手数料を適用', 'wc2'); ?> </option> <option value="price"<?php if ($payment_charge == 'price') { echo ' selected="selected"'; } ?> ><?php _e('金額を適用', 'wc2'); ?> </option> </select> <span id="payment-charge-price-input-<?php echo $id; ?> "<?php echo $display; ?> ><input type="text" id="payment-charge-price-<?php echo $id; ?> " class="small-text right" value="<?php esc_html_e($charge_price); ?> "><?php echo wc2_crcode(); ?> </span> </td> </tr> <?php $html = ob_get_contents(); ob_end_clean(); return $html; }
function wc2_ordermail($data, $send = 'order') { $cart = $data['cart']; $payment = wc2_get_payment($data['payment_method']); $general_options = wc2_get_option('general'); $total_price = $data['item_total_price'] - $data['usedpoint'] + $data['discount'] + $data['shipping_charge'] + $data['cod_fee'] + $data['tax']; $msg_body = ""; if ($data['order_type'] == 'estimate') { $msg_top = "\r\n\r\n\r\n" . __('【お見積】', 'wc2') . "\r\n"; $msg_top .= wc2_mail_line(1, $data['email']); //******************** $msg_top .= apply_filters('wc2_filter_ordermail_first', "", $data, $payment, $send); $msg_top .= wc2_get_mail_addressform($data, 'customer'); $msg_top .= __('お見積番号', 'wc2') . " : " . $data['order_id'] . "\r\n"; } else { $msg_top = "\r\n\r\n\r\n" . __('【ご注文内容】', 'wc2') . "\r\n"; $msg_top .= wc2_mail_line(1, $data['email']); //******************** $msg_top .= apply_filters('wc2_filter_ordermail_first', "", $data, $payment, $send); $msg_top .= wc2_get_mail_addressform($data, 'customer'); $msg_top .= __('Order number', 'wc2') . " : " . $data['dec_order_id'] . "\r\n"; $msg_top .= __('注文日時', 'wc2') . " : " . $data['order_date'] . "\r\n"; } $msg_top .= "\r\n"; $msg_body = apply_filters('wc2_filter_ordermail_top', $msg_top, $data, $payment, $send); $msg_detail = __('Items', 'wc2') . "\r\n"; foreach ($cart as $idx => $cart_row) { // $item_id = $cart_row['item_id']; // $sku_id = $cart_row['sku_id']; $item_name = $cart_row['item_name']; $item_code = $cart_row['item_code']; $sku_name = $cart_row['sku_name']; $sku_code = $cart_row['sku_code']; $cart_item_name = wc2_get_cart_item_name($item_name, $item_code, $sku_name, $sku_code); $cart_options = ''; $msg_detail .= wc2_mail_line(2, $data['email']); //-------------------- $msg_detail .= $cart_item_name . "\r\n"; if (is_array($cart_options) && count($cart_options) > 0) { $optstr = ''; foreach ($cart_options as $key => $value) { if (!empty($key)) { $key = urldecode($key); if (is_array($value)) { $c = ''; $optstr .= $key . ' : '; foreach ($value as $v) { $optstr .= $c . urldecode($v); $c = ', '; } $optstr .= "\r\n"; } else { $optstr .= $key . ' : ' . urldecode($value) . "\r\n"; } } } $msg_detail .= apply_filters('wc2_filter_ordermail_cartrow_options', $optstr, $cart_options, $send); } $msg_detail .= __('単価', 'wc2') . " " . wc2_crform($cart_row['price'], true, false) . __(' * ', 'wc2') . $cart_row['quantity'] . "\r\n"; } $msg_detail .= wc2_mail_line(3, $data['email']); //==================== $msg_detail .= __('商品合計', 'wc2') . " : " . wc2_crform($data['item_total_price'], true, false) . "\r\n"; if ($data['discount'] != 0) { $msg_detail .= apply_filters('wc2_filter_discount_label', __('値引', 'wc2'), $data['order_id']) . " : " . wc2_crform($data['discount'], true, false) . "\r\n"; } if (0.0 < (double) $data['tax'] && 'products' == $general_options['tax_target']) { $msg_detail .= wc2_tax_label($data) . " : " . wc2_crform($data['tax'], true, false) . "\r\n"; } $msg_detail .= __('送料', 'wc2') . " : " . wc2_crform($data['shipping_charge'], true, false) . "\r\n"; if ($payment['settlement'] == 'COD') { $msg_detail .= apply_filters('wc2_filter_cod_label', __('COD fee', 'wc2')) . " : " . wc2_crform($data['cod_fee'], true, false) . "\r\n"; } if (0.0 < (double) $data['tax'] && 'all' == $general_options['tax_target']) { $msg_detail .= wc2_tax_label($data) . " : " . wc2_crform($data['tax'], true, false) . "\r\n"; } if ($data['usedpoint'] != 0) { $msg_detail .= __('ご利用ポイント', 'wc2') . " : " . number_format($data['usedpoint']) . __('ポイント', 'wc2') . "\r\n"; } $msg_detail .= wc2_mail_line(2, $data['email']); //-------------------- $msg_detail .= __('お支払金額', 'wc2') . " : " . wc2_crform($total_price, true, false) . "\r\n"; $msg_detail .= wc2_mail_line(2, $data['email']); //-------------------- $msg_detail .= "(" . __('Currency', 'wc2') . ' : ' . __(wc2_crcode(), 'wc2') . ")\r\n\r\n\r\n"; $msg_body .= apply_filters('wc2_filter_ordermail_detail', $msg_detail, $data, $payment, $send); $msg_shipping = __('【配送先】', 'wc2') . "\r\n"; $msg_shipping .= wc2_mail_line(1, $data['email']); //******************** $msg_shipping .= wc2_get_mail_addressform($data, 'delivery'); $msg_shipping .= __('配送方法', 'wc2') . " : " . $data['delivery_name'] . "\r\n"; $msg_shipping .= __('配送希望日', 'wc2') . " : " . $data['delivery_date'] . "\r\n"; $msg_shipping .= __('配送希望時間', 'wc2') . " : " . $data['delivery_time'] . "\r\n"; $msg_shipping .= "\r\n\r\n"; $msg_body .= apply_filters('wc2_filter_ordermail_shipping', $msg_shipping, $data, $payment, $send); $msg_payment = __('【お支払方法】', 'wc2') . "\r\n"; $msg_payment .= wc2_mail_line(1, $data['email']); //******************** $msg_payment .= $payment['name'] . wc2_payment_detail($data) . "\r\n\r\n"; if ($payment['settlement'] == 'BT') { $transferee = __('お振込先', 'wc2') . " : \r\n"; $transferee .= wc2_get_option('transferee_info') . "\r\n\r\n"; $transferee .= wc2_mail_line(2, $data['email']) . "\r\n"; //-------------------- $msg_payment .= apply_filters('wc2_filter_mail_transferee', $transferee, $data, $payment, $send); } $msg_payment .= "\r\n\r\n"; $msg_body .= apply_filters('wc2_filter_ordermail_payment', $msg_payment, $data, $payment, $send); $msg_other = __('【その他】', 'wc2') . "\r\n"; $msg_other .= wc2_mail_line(1, $data['email']); //******************** $msg_other .= wc2_mail_custom_field_info($data, 'order', 'beforeremarks'); $msg_other .= $data['note'] . "\r\n"; $msg_other .= wc2_mail_custom_field_info($data, 'order', 'other'); $msg_other .= "\r\n\r\n\r\n"; $msg_body .= apply_filters('wc2_filter_ordermail_other', $msg_other, $data, $payment, $send); $msg_body = apply_filters('wc2_filter_ordermail_body', $msg_body, $data, $payment, $send); return $msg_body; }