PluginProbe
Welcart e-Commerce / 2.12.4
Welcart e-Commerce v2.12.4
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
← All changes | includes/admin_cart.php +636 -568 1.4.12.12.4 View file →
@@ -1,665 +1,733 @@
1 1 <?php
2 -$status = $this->action_status;
3 -$message = $this->action_message;
4 -$this->action_status = 'none';
5 -$this->action_message = '';
6 -if( !empty($this->options['cart_page_data']) ){
7 - $cart_page_datas = stripslashes_deep($this->options['cart_page_data']);
8 -}else{
2 +/**
3 + * Cart Page Settings.
4 + *
5 + * @package Welcart
6 + */
7 +
8 +if ( ! empty( $this->options['cart_page_data'] ) ) {
9 + $cart_page_datas = stripslashes_deep( $this->options['cart_page_data'] );
10 +} else {
9 11 $cart_page_datas['header'] = array();
10 12 $cart_page_datas['footer'] = array();
11 13 }
12 14 $indi_item_name = $this->options['indi_item_name'];
13 -$pos_item_name = $this->options['pos_item_name'];
14 -foreach( (array)$indi_item_name as $key => $value){
15 - $checked_item_name[$key] = $indi_item_name[$key] == 1 ? ' checked="checked"' : '';
15 +$pos_item_name = $this->options['pos_item_name'];
16 +foreach ( (array) $indi_item_name as $key => $value ) {
17 + $checked_item_name[ $key ] = ( 1 == $indi_item_name[ $key ] ) ? ' checked="checked"' : '';
16 18 }
19 +$cart_header = ( isset( $cart_page_datas['header']['cart'] ) ) ? $cart_page_datas['header']['cart'] : '';
20 +$cart_footer = ( isset( $cart_page_datas['footer']['cart'] ) ) ? $cart_page_datas['footer']['cart'] : '';
21 +$customer_header = ( isset( $cart_page_datas['header']['customer'] ) ) ? $cart_page_datas['header']['customer'] : '';
22 +$customer_footer = ( isset( $cart_page_datas['footer']['customer'] ) ) ? $cart_page_datas['footer']['customer'] : '';
23 +$delivery_header = ( isset( $cart_page_datas['header']['delivery'] ) ) ? $cart_page_datas['header']['delivery'] : '';
24 +$delivery_footer = ( isset( $cart_page_datas['footer']['delivery'] ) ) ? $cart_page_datas['footer']['delivery'] : '';
25 +$confirm_header = ( isset( $cart_page_datas['header']['confirm'] ) ) ? $cart_page_datas['header']['confirm'] : '';
26 +$confirm_footer = ( isset( $cart_page_datas['footer']['confirm'] ) ) ? $cart_page_datas['footer']['confirm'] : '';
27 +$completion_header = ( isset( $cart_page_datas['header']['completion'] ) ) ? $cart_page_datas['header']['completion'] : '';
28 +$completion_footer = ( isset( $cart_page_datas['footer']['completion'] ) ) ? $cart_page_datas['footer']['completion'] : '';
29 +$confirm_notes = ( isset( $cart_page_datas['confirm_notes'] ) ) ? $cart_page_datas['confirm_notes'] : '';
17 30 ?>
18 31 <script type="text/javascript">
19 -jQuery(function($){
20 -<?php if($status == 'success'){ ?>
21 - $("#anibox").animate({ backgroundColor: "#ECFFFF" }, 2000);
22 -<?php }else if($status == 'caution'){ ?>
23 - $("#anibox").animate({ backgroundColor: "#FFF5CE" }, 2000);
24 -<?php }else if($status == 'error'){ ?>
25 - $("#anibox").animate({ backgroundColor: "#FFE6E6" }, 2000);
26 -<?php } ?>
32 +jQuery(function($) {
27 33
28 - $("#aAdditionalURLs").click(function () {
29 - $("#AdditionalURLs").toggle();
34 + $(".num").bind("change",function(){usces_check_num($(this));});
35 +
36 + $( "#uscestabs_cart" ).tabs({
37 + active: ( $.cookie( "uscestabs_cart" ) ) ? $.cookie( "uscestabs_cart" ) : 0
38 + , activate: function( event, ui ) {
39 + $.cookie( "uscestabs_cart", $(this).tabs( "option", "active" ) );
40 + }
30 41 });
31 42
32 - $(".num").bind("change", function(){ usces_check_num($(this)); });
33 -
34 - //20100818ysk start
35 - //20100809ysk start
36 - if( $.fn.jquery < "1.10" ) {
37 - var $tabs = $('#uscestabs_cart').tabs({
38 - cookie: {
39 - // store cookie for a day, without, it would be a session cookie
40 - expires: 1
41 - }
42 - });
43 - } else {
44 - $( "#uscestabs_cart" ).tabs({
45 - active: ($.cookie("uscestabs_cart")) ? $.cookie("uscestabs_cart") : 0
46 - , activate: function( event, ui ){
47 - $.cookie("uscestabs_cart", $(this).tabs("option", "active"));
48 - }
49 - });
50 - }
51 -
52 - //customOrder = {
53 43 customField = {
54 44 settings: {
55 45 url: uscesL10n.requestFile,
56 46 type: 'POST',
57 47 cache: false
58 - //cache: false,
59 - //success: function(data, dataType) {
60 - // $("tbody#item-opt-list").html(data);
61 - //},
62 - //error: function(msg) {
63 - // $("#ajax-response").html(msg);
64 - //}
65 48 },
66 49
67 50 //** Custom Order **
68 - //add: function() {
69 51 addOrder: function() {
70 - //if($("#newcsodkey").val() == '' || $("#newcsodname").val() == '') return;
71 -
72 - var key = $("#newcsodkey").val();
73 - var name = $("#newcsodname").val();
74 - var value = $("#newcsodvalue").val();
75 - var means = $("#newcsodmeans").val();
76 - var essential = ($("input#newcsodessential").attr("checked")) ? '1' : '0';
52 + var key = $( "#newcsodkey" ).val();
53 + var name = $( "#newcsodname" ).val();
54 + var value = $( "#newcsodvalue" ).val();
55 + var means = $( "#newcsodmeans" ).val();
56 + var essential = ( $( "input#newcsodessential" ).prop( "checked" ) ) ? '1' : '0';
77 57 var mes = '';
78 - if( '' == key || !checkCode( key ) )
79 - mes += '<p>フィールドキーは半角英数(-_を含む)で入力して下さい。</p>';
80 - if( '' == name )
81 - mes += '<p>フィールド名の値を入力してください。</p>';
82 - if( 2 != means && '' == value )
83 - mes += '<p>セレクト値を入力してください。</p>';
58 + if( '' == key || !checkCode( key ) ) {
59 + mes += '<p>'+uscesL10n.message[21]+'</p>';
60 + }
61 + if( '' == name ) {
62 + mes += '<p>'+uscesL10n.message[22]+'</p>';
63 + }
64 + if( '' == value && ( 0 == means || 1 == means || 3 == means || 4 == means ) ) {
65 + mes += '<p>'+uscesL10n.message[2]+'</p>';
66 + } else if( '' != value && ( 2 == means || 5 == means ) ) {
67 + mes += '<p>'+uscesL10n.message[3]+'</p>';
68 + }
84 69 if( '' != mes ) {
85 70 mes = '<div class="error">'+mes+'</div>';
86 - $("#ajax-response-csod").html(mes);
71 + $( "#ajax-response-csod" ).html( mes );
87 72 return false;
88 73 }
89 74
90 - $("#newcsod_loading").html('<img src="' + uscesL10n.USCES_PLUGIN_URL + '/images/loading.gif" />');
75 + $( "#newcsod_loading" ).html( '<img src="'+uscesL10n.USCES_PLUGIN_URL+'/images/loading.gif" />' );
91 76
92 - //var s = customOrder.settings;
93 77 var s = customField.settings;
94 - //s.data = "action=custom_order_ajax&add=1&newcsodkey="+key+"&newcsodname="+name+"&newcsodvalue="+value+"&newcsodmeans="+means+"&newcsodessential="+essential;
95 - s.data = "action=custom_field_ajax&field=order&add=1&newkey="+key+"&newname="+name+"&newvalue="+value+"&newmeans="+means+"&newessential="+essential;
96 - s.success = function(data, dataType) {
97 - $("#ajax-response-csod").html('');
98 - $("#newcsod_loading").html('');
99 - var strs = data.split('#usces#');
100 - var list = strs[0];
101 - var dupkey = strs[1];
102 - if( 0 < dupkey ) {
103 - $("#ajax-response-csod").html('<div class="error"><p>同じフィールドキーが存在します。</p></div>');
104 - }else{
105 - if(list.length > 1) $("table#csod-list-table").removeAttr("style");
106 - $("tbody#csod-list").html(list);
107 - $("#csod-" + key).css({'background-color': '#FF4'});
108 - $("#csod-" + key).animate({ 'background-color': '#FFFFEE' }, 2000 );
109 - $("#newcsodkey").val("");
110 - $("#newcsodname").val("");
111 - $("#newcsodvalue").val("");
112 - $("#newcsodmeans").val(0);
113 - $("#newcsodessential").attr({checked: false});
78 + s.data = {
79 + action: 'custom_field_ajax',
80 + field: 'order',
81 + add: 1,
82 + newkey: key,
83 + newname: name,
84 + newvalue: value,
85 + newmeans: means,
86 + newessential: essential,
87 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
88 + }
89 + s.dataType = 'json';
90 + $.ajax( s ).done(function( data ) {
91 + $( "#ajax-response-csod" ).html( '' );
92 + $( "#newcsod_loading" ).html( '' );
93 + if( 'OK' == data.status ) {
94 + if( 0 < data.dupkey ) {
95 + $( "#ajax-response-csod" ).html( '<div class="error"><p>'+uscesL10n.message[23]+'</p></div>' );
96 + } else {
97 + if( data.list.length > 1 ) $( "table#csod-list-table" ).removeAttr( "style" );
98 + $( "tbody#csod-list" ).html( data.list );
99 + $( "#csod-"+key ).css( { 'background-color': '#FF4' } );
100 + $( "#csod-"+key ).animate( { 'background-color': '#FFFFEE' }, 2000 );
101 + $( "#newcsodkey" ).val( "" );
102 + $( "#newcsodname" ).val( "" );
103 + $( "#newcsodvalue" ).val( "" );
104 + $( "#newcsodmeans" ).val( 0 );
105 + $( "#newcsodessential" ).prop( { checked: false } );
106 + }
107 + } else {
108 + if( 0 < data.msg.length ) $( "#ajax-response-csod" ).html( data.msg );
114 109 }
115 - };
116 - s.error = function(msg) {
117 - $("#ajax-response-csod").html(msg);
118 - $("#newcsod_loading").html('');
119 - };
120 - $.ajax(s);
110 + }).fail(function( msg ) {
111 + $( "#ajax-response-csod" ).html( msg );
112 + $( "#newcsod_loading" ).html( '' );
113 + });
121 114 return false;
122 115 },
123 116
124 - //upd: function(key) {
125 - updOrder: function(key) {
126 - var name = $(':input[name="csod['+key+'][name]"]').val();
127 - var value = $(':input[name="csod['+key+'][value]"]').val();
128 - var means = $(':input[name="csod['+key+'][means]"]').val();
129 - var essential = ($(':input[name="csod['+key+'][essential]"]').attr("checked")) ? '1' : '0';
117 + updOrder: function( key ) {
118 + var name = $( ':input[name="csod['+key+'][name]"]' ).val();
119 + var value = $( ':input[name="csod['+key+'][value]"]' ).val();
120 + var means = $( ':input[name="csod['+key+'][means]"]' ).val();
121 + var essential = ( $( ':input[name="csod['+key+'][essential]"]' ).prop( "checked" ) ) ? '1' : '0';
130 122 var mes = '';
131 - if( '' == name )
132 - mes += '<p>フィールド名の値を入力してください。</p>';
133 - if( 2 != means && '' == value )
134 - mes += '<p>セレクト値を入力してください。</p>';
123 + if( '' == key || !checkCode( key ) ) {
124 + mes += '<p>'+uscesL10n.message[21]+'</p>';
125 + }
126 + if( '' == name ) {
127 + mes += '<p>'+uscesL10n.message[22]+'</p>';
128 + }
129 + if( '' == value && ( 0 == means || 1 == means || 3 == means || 4 == means ) ) {
130 + mes += '<p>'+uscesL10n.message[2]+'</p>';
131 + } else if( '' != value && ( 2 == means || 5 == means ) ) {
132 + mes += '<p>'+uscesL10n.message[3]+'</p>';
133 + }
135 134 if( '' != mes ) {
136 135 mes = '<div class="error">'+mes+'</div>';
137 - $("#ajax-response-csod").html(mes);
136 + $( "#ajax-response-csod" ).html( mes );
138 137 return false;
139 138 }
140 139
141 - $("#csod_loading-" + key).html('<img src="' + uscesL10n.USCES_PLUGIN_URL + '/images/loading.gif" />');
140 + $( "#csod_loading-"+key ).html( '<img src="'+uscesL10n.USCES_PLUGIN_URL+'/images/loading.gif" />' );
142 141
143 - //var s = customOrder.settings;
144 142 var s = customField.settings;
145 - //s.data = "action=custom_order_ajax&update=1&csodkey="+key+"&csodname="+name+"&csodvalue="+value+"&csodmeans="+means+"&csodessential="+essential;
146 - s.data = "action=custom_field_ajax&field=order&update=1&key="+key+"&name="+name+"&value="+value+"&means="+means+"&essential="+essential;
147 - s.success = function(data, dataType) {
148 - $("#ajax-response-csod").html('');
149 - $("#csod_loading-" + key).html('');
150 - var strs = data.split('#usces#');
151 - var list = strs[0];
152 - $("tbody#csod-list").html(list);
153 - $("#csod-" + key).css({'background-color': '#FF4'});
154 - $("#csod-" + key).animate({ 'background-color': '#FFFFEE' }, 2000 );
155 - };
156 - s.error = function(msg) {
157 - $("#ajax-response-csod").html(msg);
158 - $("#csod_loading-" + key).html('');
159 - };
160 - $.ajax(s);
143 + s.data = {
144 + action: 'custom_field_ajax',
145 + field: 'order',
146 + update: 1,
147 + key: key,
148 + name: name,
149 + value: value,
150 + means: means,
151 + essential: essential,
152 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
153 + }
154 + s.dataType = 'json';
155 + $.ajax( s ).done(function( data ) {
156 + $( "#ajax-response-csod" ).html( '' );
157 + $( "#csod_loading-"+key ).html( '' );
158 + if( 'OK' == data.status ) {
159 + $( "tbody#csod-list" ).html( data.list );
160 + $( "#csod-"+key ).css( { 'background-color': '#FF4' } );
161 + $( "#csod-"+key ).animate( { 'background-color': '#FFFFEE' }, 2000 );
162 + } else {
163 + if( 0 < data.msg.length ) $( "#ajax-response-csod" ).html( data.msg );
164 + }
165 + }).fail(function( msg ) {
166 + $( "#ajax-response-csod" ).html( msg );
167 + $( "#csod_loading-"+key ).html( '' );
168 + });
161 169 return false;
162 170 },
163 171
164 - //del: function(key) {
165 - delOrder: function(key) {
166 - $("#csod-" + key).css({'background-color': '#F00'});
167 - $("#csod-" + key).animate({ 'background-color': '#FFFFEE' }, 1000 );
168 - //var s = customOrder.settings;
172 + delOrder: function( key ) {
173 + $( "#csod-"+key ).css( { 'background-color': '#F00' } );
174 + $( "#csod-"+key ).animate( { 'background-color': '#FFFFEE' }, 1000 );
169 175 var s = customField.settings;
170 - //s.data = "action=custom_order_ajax&delete=1&csodkey="+key;
171 - s.data = "action=custom_field_ajax&field=order&delete=1&key="+key;
172 - s.success = function(data, dataType) {
173 - $("#ajax-response-csod").html('');
174 - var strs = data.split('#usces#');
175 - var list = strs[0];
176 - $("tbody#csod-list").html(list);
177 - if(list.length < 1) $("table#csod-list-table").attr("style", "display: none");
178 - };
179 - s.error = function(msg) {
180 - $("#ajax-response-csod").html(msg);
181 - };
182 - $.ajax(s);
176 + s.data = {
177 + action: 'custom_field_ajax',
178 + field: 'order',
179 + delete: 1,
180 + key: key,
181 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
182 + }
183 + s.dataType = 'json';
184 + $.ajax( s ).done(function( data ) {
185 + $( "#ajax-response-csod" ).html( '' );
186 + if( 'OK' == data.status ) {
187 + $( "tbody#csod-list" ).html( data.list );
188 + if( data.list.length < 1 ) $( "table#csod-list-table" ).attr( "style", "display: none" );
189 + } else {
190 + if( 0 < data.msg.length ) $( "#ajax-response-csod" ).html( data.msg );
191 + }
192 + }).fail(function( msg ) {
193 + $( "#ajax-response-csod" ).html( msg );
194 + });
183 195 return false;
184 196 },
185 197
186 198 //** Custom Customer **
187 199 addCustomer: function() {
188 - //if($("#newcscskey").val() == '' || $("#newcscsname").val() == '') return;
189 -
190 - var key = $("#newcscskey").val();
191 - var name = $("#newcscsname").val();
192 - var value = $("#newcscsvalue").val();
193 - var means = $("#newcscsmeans").val();
194 - var essential = ($("input#newcscsessential").attr("checked")) ? '1' : '0';
195 - var position = $("#newcscsposition").val();
200 + var key = $( "#newcscskey" ).val();
201 + var name = $( "#newcscsname" ).val();
202 + var value = $( "#newcscsvalue" ).val();
203 + var means = $( "#newcscsmeans" ).val();
204 + var essential = ( $( "input#newcscsessential" ).prop( "checked" ) ) ? '1' : '0';
205 + var position = $( "#newcscsposition" ).val();
196 206 var mes = '';
197 - if( '' == key || !checkCode( key ) )
198 - mes += '<p>フィールドキーは半角英数(-_を含む)で入力して下さい。</p>';
199 - if( '' == name )
200 - mes += '<p>フィールド名の値を入力してください。</p>';
201 - if( 2 != means && '' == value )
202 - mes += '<p>セレクト値を入力してください。</p>';
207 + if( '' == key || !checkCode( key ) ) {
208 + mes += '<p>'+uscesL10n.message[21]+'</p>';
209 + }
210 + if( '' == name ) {
211 + mes += '<p>'+uscesL10n.message[22]+'</p>';
212 + }
213 + if( '' == value && ( 0 == means || 1 == means || 3 == means || 4 == means ) ) {
214 + mes += '<p>'+uscesL10n.message[2]+'</p>';
215 + } else if( '' != value && ( 2 == means || 5 == means ) ) {
216 + mes += '<p>'+uscesL10n.message[3]+'</p>';
217 + }
203 218 if( '' != mes ) {
204 219 mes = '<div class="error">'+mes+'</div>';
205 - $("#ajax-response-cscs").html(mes);
220 + $( "#ajax-response-cscs" ).html( mes );
206 221 return false;
207 222 }
208 223
209 - $("#newcscs_loading").html('<img src="' + uscesL10n.USCES_PLUGIN_URL + '/images/loading.gif" />');
224 + $( "#newcscs_loading" ).html( '<img src="'+uscesL10n.USCES_PLUGIN_URL+'/images/loading.gif" />' );
210 225
211 226 var s = customField.settings;
212 - s.data = "action=custom_field_ajax&field=customer&add=1&newkey="+key+"&newname="+name+"&newvalue="+value+"&newmeans="+means+"&newessential="+essential+"&newposition="+position;
213 - s.success = function(data, dataType) {
214 - $("#ajax-response-cscs").html('');
215 - $("#newcscs_loading").html('');
216 - var strs = data.split('#usces#');
217 - var list = strs[0];
218 - var dupkey = strs[1];
219 - if( 0 < dupkey ) {
220 - $("#ajax-response-cscs").html('<div class="error"><p>同じフィールドキーが存在します。</p></div>');
221 - }else{
222 - if(list.length > 1) $("table#cscs-list-table").removeAttr("style");
223 - $("tbody#cscs-list").html(list);
224 - $("#cscs-" + key).css({'background-color': '#FF4'});
225 - $("#cscs-" + key).animate({ 'background-color': '#FFFFEE' }, 2000 );
226 - $("#newcscskey").val("");
227 - $("#newcscsname").val("");
228 - $("#newcscsvalue").val("");
229 - $("#newcscsmeans").val(0);
230 - $("#newcscsessential").attr({checked: false});
227 + s.data = {
228 + action: 'custom_field_ajax',
229 + field: 'customer',
230 + add: 1,
231 + newkey: key,
232 + newname: name,
233 + newvalue: value,
234 + newmeans: means,
235 + newessential: essential,
236 + newposition: position,
237 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
238 + }
239 + s.dataType = 'json';
240 + $.ajax( s ).done(function( data ) {
241 + $( "#ajax-response-cscs" ).html( '' );
242 + $( "#newcscs_loading" ).html( '' );
243 + if( 'OK' == data.status ) {
244 + if( 0 < data.dupkey ) {
245 + $( "#ajax-response-cscs" ).html( '<div class="error"><p>'+uscesL10n.message[23]+'</p></div>' );
246 + } else {
247 + if( data.list.length > 1 ) $( "table#cscs-list-table" ).removeAttr( "style" );
248 + $( "tbody#cscs-list" ).html( data.list );
249 + $( "#cscs-"+key ).css( { 'background-color': '#FF4' } );
250 + $( "#cscs-"+key ).animate( { 'background-color': '#FFFFEE' }, 2000 );
251 + $( "#newcscskey" ).val( "" );
252 + $( "#newcscsname" ).val( "" );
253 + $( "#newcscsvalue" ).val( "" );
254 + $( "#newcscsmeans" ).val( 0 );
255 + $( "#newcscsessential" ).prop( { checked: false } );
256 + }
257 + } else {
258 + if( 0 < data.msg.length ) $( "#ajax-response-cscs" ).html( data.msg );
231 259 }
232 - };
233 - s.error = function(msg) {
234 - $("#ajax-response-cscs").html(msg);
235 - $("#newcscs_loading").html('');
236 - };
237 - $.ajax(s);
260 + }).fail(function( msg ) {
261 + $( "#ajax-response-cscs" ).html( msg );
262 + $( "#newcscs_loading" ).html( '' );
263 + });
238 264 return false;
239 265 },
240 266
241 267 updCustomer: function(key) {
242 - var name = $(':input[name="cscs['+key+'][name]"]').val();
243 - var value = $(':input[name="cscs['+key+'][value]"]').val();
244 - var means = $(':input[name="cscs['+key+'][means]"]').val();
245 - var essential = ($(':input[name="cscs['+key+'][essential]"]').attr("checked")) ? '1' : '0';
246 - var position = $(':input[name="cscs['+key+'][position]"]').val();
268 + var name = $( ':input[name="cscs['+key+'][name]"]' ).val();
269 + var value = $( ':input[name="cscs['+key+'][value]"]' ).val();
270 + var means = $( ':input[name="cscs['+key+'][means]"]' ).val();
271 + var essential = ( $( ':input[name="cscs['+key+'][essential]"]' ).prop( "checked" ) ) ? '1' : '0';
272 + var position = $( ':input[name="cscs['+key+'][position]"]' ).val();
247 273 var mes = '';
248 - if( '' == name )
249 - mes += '<p>フィールド名の値を入力してください。</p>';
250 - if( 2 != means && '' == value )
251 - mes += '<p>セレクト値を入力してください。</p>';
274 + if( '' == key || !checkCode( key ) ) {
275 + mes += '<p>'+uscesL10n.message[21]+'</p>';
276 + }
277 + if( '' == name ) {
278 + mes += '<p>'+uscesL10n.message[22]+'</p>';
279 + }
280 + if( '' == value && ( 0 == means || 1 == means || 3 == means || 4 == means ) ) {
281 + mes += '<p>'+uscesL10n.message[2]+'</p>';
282 + } else if( '' != value && ( 2 == means || 5 == means ) ) {
283 + mes += '<p>'+uscesL10n.message[3]+'</p>';
284 + }
252 285 if( '' != mes ) {
253 286 mes = '<div class="error">'+mes+'</div>';
254 - $("#ajax-response-cscs").html(mes);
287 + $("#ajax-response-cscs").html( mes );
255 288 return false;
256 289 }
257 290
258 - $("#cscs_loading-" + key).html('<img src="' + uscesL10n.USCES_PLUGIN_URL + '/images/loading.gif" />');
291 + $( "#cscs_loading-"+key ).html( '<img src="'+uscesL10n.USCES_PLUGIN_URL+'/images/loading.gif" />' );
259 292
260 293 var s = customField.settings;
261 - s.data = "action=custom_field_ajax&field=customer&update=1&key="+key+"&name="+name+"&value="+value+"&means="+means+"&essential="+essential+"&position="+position;
262 - s.success = function(data, dataType) {
263 - $("#ajax-response-cscs").html('');
264 - $("#cscs_loading-" + key).html('');
265 - var strs = data.split('#usces#');
266 - var list = strs[0];
267 - $("tbody#cscs-list").html(list);
268 - $("#cscs-" + key).css({'background-color': '#FF4'});
269 - $("#cscs-" + key).animate({ 'background-color': '#FFFFEE' }, 2000 );
270 - };
271 - s.error = function(msg) {
272 - $("#ajax-response-cscs").html(msg);
273 - $("#cscs_loading-" + key).html('');
274 - };
275 - $.ajax(s);
294 + s.data = {
295 + action: 'custom_field_ajax',
296 + field: 'customer',
297 + update: 1,
298 + key: key,
299 + name: name,
300 + value: value,
301 + means: means,
302 + essential: essential,
303 + position: position,
304 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
305 + }
306 + s.dataType = 'json';
307 + $.ajax( s ).done(function( data ) {
308 + $( "#ajax-response-cscs" ).html( '' );
309 + $( "#cscs_loading-"+key ).html( '' );
310 + if( 'OK' == data.status ) {
311 + $( "tbody#cscs-list" ).html( data.list );
312 + $( "#cscs-"+key ).css( { 'background-color': '#FF4' } );
313 + $( "#cscs-"+key ).animate( { 'background-color': '#FFFFEE' }, 2000 );
314 + } else {
315 + if( 0 < data.msg.length ) $( "#ajax-response-cscs" ).html( data.msg );
316 + }
317 + }).fail(function( msg ) {
318 + $( "#ajax-response-cscs" ).html( msg );
319 + $( "#cscs_loading-"+key ).html( '' );
320 + });
276 321 return false;
277 322 },
278 323
279 - delCustomer: function(key) {
280 - $("#cscs-" + key).css({'background-color': '#F00'});
281 - $("#cscs-" + key).animate({ 'background-color': '#FFFFEE' }, 1000 );
324 + delCustomer: function( key ) {
325 + $( "#cscs-"+key ).css( { 'background-color': '#F00' } );
326 + $( "#cscs-"+key ).animate( { 'background-color': '#FFFFEE' }, 1000 );
282 327 var s = customField.settings;
283 - s.data = "action=custom_field_ajax&field=customer&delete=1&key="+key;
284 - s.success = function(data, dataType) {
285 - $("#ajax-response-cscs").html('');
286 - var strs = data.split('#usces#');
287 - var list = strs[0];
288 - $("tbody#cscs-list").html(list);
289 - if(list.length < 1) $("table#cscs-list-table").attr("style", "display: none");
290 - };
291 - s.error = function(msg) {
292 - $("#ajax-response-cscs").html(msg);
293 - };
294 - $.ajax(s);
328 + s.data = {
329 + action: 'custom_field_ajax',
330 + field: 'customer',
331 + delete: 1,
332 + key: key,
333 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
334 + }
335 + s.dataType = 'json';
336 + $.ajax(s).done(function( data ) {
337 + $( "#ajax-response-cscs" ).html( '' );
338 + if( 'OK' == data.status ) {
339 + $( "tbody#cscs-list" ).html( data.list );
340 + if( data.list.length < 1 ) $( "table#cscs-list-table" ).attr( "style", "display: none" );
341 + } else {
342 + if( 0 < data.msg.length ) $( "#ajax-response-csmb" ).html( data.msg );
343 + }
344 + }).fail(function( msg ) {
345 + $( "#ajax-response-cscs" ).html( msg );
346 + });
295 347 return false;
296 348 },
297 349
298 350 //** Custom Delivery **
299 351 addDelivery: function() {
300 - //if($("#newcsdekey").val() == '' || $("#newcsdename").val() == '') return;
301 -
302 - var key = $("#newcsdekey").val();
303 - var name = $("#newcsdename").val();
304 - var value = $("#newcsdevalue").val();
305 - var means = $("#newcsdemeans").val();
306 - var essential = ($("input#newcsdeessential").attr("checked")) ? '1' : '0';
307 - var position = $("#newcsdeposition").val();
352 + var key = $( "#newcsdekey" ).val();
353 + var name = $( "#newcsdename" ).val();
354 + var value = $( "#newcsdevalue" ).val();
355 + var means = $( "#newcsdemeans" ).val();
356 + var essential = ( $( "input#newcsdeessential" ).prop( "checked" ) ) ? '1' : '0';
357 + var position = $( "#newcsdeposition" ).val();
308 358 var mes = '';
309 - if( '' == key || !checkCode( key ) )
310 - mes += '<p>フィールドキーは半角英数(-_を含む)で入力して下さい。</p>';
311 - if( '' == name )
312 - mes += '<p>フィールド名の値を入力してください。</p>';
313 - if( 2 != means && '' == value )
314 - mes += '<p>セレクト値を入力してください。</p>';
359 + if( '' == key || !checkCode( key ) ) {
360 + mes += '<p>'+uscesL10n.message[21]+'</p>';
361 + }
362 + if( '' == name ) {
363 + mes += '<p>'+uscesL10n.message[22]+'</p>';
364 + }
365 + if( '' == value && ( 0 == means || 1 == means || 3 == means || 4 == means ) ) {
366 + mes += '<p>'+uscesL10n.message[2]+'</p>';
367 + } else if( '' != value && ( 2 == means || 5 == means ) ) {
368 + mes += '<p>'+uscesL10n.message[3]+'</p>';
369 + }
315 370 if( '' != mes ) {
316 371 mes = '<div class="error">'+mes+'</div>';
317 - $("#ajax-response-csde").html(mes);
372 + $("#ajax-response-csde").html( mes );
318 373 return false;
319 374 }
320 375
321 - $("#newcsde_loading").html('<img src="' + uscesL10n.USCES_PLUGIN_URL + '/images/loading.gif" />');
376 + $( "#newcsde_loading" ).html( '<img src="'+uscesL10n.USCES_PLUGIN_URL+'/images/loading.gif" />' );
322 377
323 378 var s = customField.settings;
324 - s.data = "action=custom_field_ajax&field=delivery&add=1&newkey="+key+"&newname="+name+"&newvalue="+value+"&newmeans="+means+"&newessential="+essential+"&newposition="+position;
325 - s.success = function(data, dataType) {
326 - $("#ajax-response-csde").html('');
327 - $("#newcsde_loading").html('');
328 - var strs = data.split('#usces#');
329 - var list = strs[0];
330 - var dupkey = strs[1];
331 - if( 0 < dupkey ) {
332 - $("#ajax-response-csde").html('<div class="error"><p>同じフィールドキーが存在します。</p></div>');
333 - }else{
334 - if(list.length > 1) $("table#csde-list-table").removeAttr("style");
335 - $("tbody#csde-list").html(list);
336 - $("#csde-" + key).css({'background-color': '#FF4'});
337 - $("#csde-" + key).animate({ 'background-color': '#FFFFEE' }, 2000 );
338 - $("#newcsdekey").val("");
339 - $("#newcsdename").val("");
340 - $("#newcsdevalue").val("");
341 - $("#newcsdemeans").val(0);
342 - $("#newcsdeessential").attr({checked: false});
379 + s.data = {
380 + action: 'custom_field_ajax',
381 + field: 'delivery',
382 + add: 1,
383 + newkey: key,
384 + newname: name,
385 + newvalue: value,
386 + newmeans: means,
387 + newessential: essential,
388 + newposition: position,
389 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
390 + }
391 + s.dataType = 'json';
392 + $.ajax( s ).done(function( data ) {
393 + $( "#ajax-response-csde" ).html( '' );
394 + $( "#newcsde_loading" ).html( '' );
395 + if( 'OK' == data.status ) {
396 + if( 0 < data.dupkey ) {
397 + $( "#ajax-response-csde" ).html( '<div class="error"><p>'+uscesL10n.message[23]+'</p></div>' );
398 + } else {
399 + if( data.list.length > 1 ) $( "table#csde-list-table" ).removeAttr( "style" );
400 + $( "tbody#csde-list" ).html( data.list );
401 + $( "#csde-"+key ).css( { 'background-color': '#FF4' } );
402 + $( "#csde-"+key ).animate( { 'background-color': '#FFFFEE' }, 2000 );
403 + $( "#newcsdekey" ).val( "" );
404 + $( "#newcsdename" ).val( "" );
405 + $( "#newcsdevalue" ).val( "" );
406 + $( "#newcsdemeans" ).val( 0 );
407 + $( "#newcsdeessential" ).prop( { checked: false } );
408 + }
409 + } else {
410 + if( 0 < data.msg.length ) $( "#ajax-response-csde" ).html( data.msg );
343 411 }
344 - };
345 - s.error = function(msg) {
346 - $("#ajax-response-csde").html(msg);
347 - $("#newcsde_loading").html('');
348 - };
349 - $.ajax(s);
412 + }).fail(function( msg ) {
413 + $( "#ajax-response-csde" ).html( msg );
414 + $( "#newcsde_loading" ).html( '' );
415 + });
350 416 return false;
351 417 },
352 418
353 - updDelivery: function(key) {
354 - var name = $(':input[name="csde['+key+'][name]"]').val();
355 - var value = $(':input[name="csde['+key+'][value]"]').val();
356 - var means = $(':input[name="csde['+key+'][means]"]').val();
357 - var essential = ($(':input[name="csde['+key+'][essential]"]').attr("checked")) ? '1' : '0';
358 - var position = $(':input[name="csde['+key+'][position]"]').val();
419 + updDelivery: function( key ) {
420 + var name = $( ':input[name="csde['+key+'][name]"]' ).val();
421 + var value = $( ':input[name="csde['+key+'][value]"]' ).val();
422 + var means = $( ':input[name="csde['+key+'][means]"]' ).val();
423 + var essential = ( $( ':input[name="csde['+key+'][essential]"]' ).prop( "checked" ) ) ? '1' : '0';
424 + var position = $( ':input[name="csde['+key+'][position]"]' ).val();
359 425 var mes = '';
360 - if( '' == name )
361 - mes += '<p>フィールド名の値を入力してください。</p>';
362 - if( 2 != means && '' == value )
363 - mes += '<p>セレクト値を入力してください。</p>';
426 + if( '' == key || !checkCode( key ) ) {
427 + mes += '<p>'+uscesL10n.message[21]+'</p>';
428 + }
429 + if( '' == name ) {
430 + mes += '<p>'+uscesL10n.message[22]+'</p>';
431 + }
432 + if( '' == value && ( 0 == means || 1 == means || 3 == means || 4 == means ) ) {
433 + mes += '<p>'+uscesL10n.message[2]+'</p>';
434 + } else if( '' != value && ( 2 == means || 5 == means ) ) {
435 + mes += '<p>'+uscesL10n.message[3]+'</p>';
436 + }
364 437 if( '' != mes ) {
365 438 mes = '<div class="error">'+mes+'</div>';
366 - $("#ajax-response-csde").html(mes);
439 + $( "#ajax-response-csde" ).html( mes );
367 440 return false;
368 441 }
369 442
370 - $("#csde_loading-" + key).html('<img src="' + uscesL10n.USCES_PLUGIN_URL + '/images/loading.gif" />');
443 + $( "#csde_loading-"+key ).html( '<img src="'+uscesL10n.USCES_PLUGIN_URL+'/images/loading.gif" />' );
371 444
372 445 var s = customField.settings;
373 - s.data = "action=custom_field_ajax&field=delivery&update=1&key="+key+"&name="+name+"&value="+value+"&means="+means+"&essential="+essential+"&position="+position;
374 - s.success = function(data, dataType) {
375 - $("#ajax-response-cscs").html('');
376 - $("#cscs_loading-" + key).html('');
377 - var strs = data.split('#usces#');
378 - var list = strs[0];
379 - $("tbody#csde-list").html(list);
380 - $("#cscs-" + key).css({'background-color': '#FF4'});
381 - $("#cscs-" + key).animate({ 'background-color': '#FFFFEE' }, 2000 );
382 - };
383 - s.error = function(msg) {
384 - $("#ajax-response-csde").html(msg);
385 - $("#cscs_loading-" + key).html('');
386 - };
387 - $.ajax(s);
446 + s.data = {
447 + action: 'custom_field_ajax',
448 + field: 'delivery',
449 + update: 1,
450 + key: key,
451 + name: name,
452 + value: value,
453 + means: means,
454 + essential: essential,
455 + position: position,
456 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
457 + }
458 + s.dataType = 'json';
459 + $.ajax( s ).done(function( data ) {
460 + $( "#ajax-response-csde" ).html( '' );
461 + $( "#csde_loading-"+key ).html( '' );
462 + if( 'OK' == data.status ) {
463 + $( "tbody#csde-list" ).html( data.list );
464 + $( "#csde-"+key ).css( { 'background-color': '#FF4' } );
465 + $( "#csde-"+key ).animate( { 'background-color': '#FFFFEE' }, 2000 );
466 + } else {
467 + if( 0 < data.msg.length ) $( "#ajax-response-csde" ).html( data.msg );
468 + }
469 + }).fail(function( msg ) {
470 + $( "#ajax-response-csde" ).html( msg );
471 + $( "#csde_loading-"+key ).html( '' );
472 + });
388 473 return false;
389 474 },
390 475
391 - delDelivery: function(key) {
392 - $("#csde-" + key).css({'background-color': '#F00'});
393 - $("#csde-" + key).animate({ 'background-color': '#FFFFEE' }, 1000 );
476 + delDelivery: function( key ) {
477 + $( "#csde-"+key ).css( { 'background-color': '#F00' } );
478 + $( "#csde-"+key ).animate( { 'background-color': '#FFFFEE' }, 1000 );
394 479 var s = customField.settings;
395 - s.data = "action=custom_field_ajax&field=delivery&delete=1&key="+key;
396 - s.success = function(data, dataType) {
397 - $("#ajax-response-csde").html('');
398 - var strs = data.split('#usces#');
399 - var list = strs[0];
400 - $("tbody#csde-list").html(list);
401 - if(list.length < 1) $("table#csde-list-table").attr("style", "display: none");
402 - };
403 - s.error = function(msg) {
404 - $("#ajax-response-csde").html(msg);
405 - };
406 - $.ajax(s);
480 + s.data = {
481 + action: 'custom_field_ajax',
482 + field: 'delivery',
483 + delete: 1,
484 + key: key,
485 + wc_nonce: '<?php echo wp_create_nonce( 'custom_field_ajax' ); ?>'
486 + }
487 + s.dataType = 'json';
488 + $.ajax( s ).done(function( data ) {
489 + $( "#ajax-response-csde" ).html( '' );
490 + if( 'OK' == data.status ) {
491 + $( "tbody#csde-list" ).html( data.list );
492 + if( data.list.length < 1 ) $( "table#csde-list-table" ).attr( "style", "display: none" );
493 + } else {
494 + if( 0 < data.msg.length ) $( "#ajax-response-csde" ).html( data.msg );
495 + }
496 + }).fail(function( msg ) {
497 + $( "#ajax-response-csde" ).html( msg );
498 + });
407 499 return false;
408 500 }
409 501 };
410 - //20100809ysk end
411 - //20100818ysk end
412 502 });
413 -
414 -function toggleVisibility(id) {
415 - var e = document.getElementById(id);
416 - if(e.style.display == 'block')
417 - e.style.display = 'none';
418 - else
419 - e.style.display = 'block';
420 -}
421 503 </script>
422 504 <div class="wrap">
423 505 <div class="usces_admin">
424 -<h2>Welcart Shop <?php _e('Cart Page Setting','usces'); ?></h2>
425 -<div id="aniboxStatus" class="<?php echo $status; ?>">
426 - <div id="anibox" class="clearfix">
427 - <img id="info_image" src="<?php echo USCES_PLUGIN_URL; ?>/images/list_message_<?php echo $status; ?>.gif" />
428 - <div class="mes" id="info_massage"><?php echo $message; ?></div>
429 - </div>
430 -</div>
506 +<h1>Welcart Shop <?php esc_html_e( 'Cart Page Setting', 'usces' ); ?></h1>
507 +<?php usces_admin_action_status(); ?>
431 508 <form action="" method="post" name="option_form" id="option_form">
432 -<input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
509 +<input name="usces_option_update" type="submit" class="button button-primary" value="<?php esc_attr_e( 'change decision', 'usces' ); ?>" />
433 510 <div id="poststuff" class="metabox-holder">
434 -
435 -<!--20100809ysk start-->
436 511 <div class="uscestabs" id="uscestabs_cart">
437 - <ul>
438 - <li><a href="#cart_page_setting_1"><?php _e('Rule of the column for a item name','usces'); ?></a></li>
439 - <li><a href="#cart_page_setting_2"><?php _e('Explanation in a Cart page','usces'); ?></a></li>
440 - <li><a href="#cart_page_setting_3"><?php _e('Custom order field','usces'); ?></a></li>
441 -<!--20100818ysk start-->
442 - <li><a href="#cart_page_setting_4"><?php _e('Custom customer field','usces'); ?></a></li>
443 - <li><a href="#cart_page_setting_5"><?php _e('Custom delivery field','usces'); ?></a></li>
444 -<!--20100818ysk end-->
445 - </ul>
512 +<ul>
513 + <li><a href="#cart_page_setting_1"><?php esc_html_e( 'Rule of the column for a item name', 'usces' ); ?></a></li>
514 + <li><a href="#cart_page_setting_2"><?php esc_html_e( 'Explanation in a Cart page', 'usces' ); ?></a></li>
515 + <li><a href="#cart_page_setting_6"><?php esc_html_e( 'Description to be displayed on the confirmation page', 'usces' ); ?></a></li>
516 + <li><a href="#cart_page_setting_3"><?php esc_html_e( 'Custom order field', 'usces' ); ?></a></li>
517 + <li><a href="#cart_page_setting_4"><?php esc_html_e( 'Custom customer field', 'usces' ); ?></a></li>
518 + <li><a href="#cart_page_setting_5"><?php esc_html_e( 'Custom delivery field', 'usces' ); ?></a></li>
519 + <?php do_action( 'usces_action_admin_cart_tab_label' ); ?>
520 +</ul>
446 521
447 522 <div id="cart_page_setting_1">
448 -<!--20100809ysk end-->
449 -
450 -<div class="postbox">
451 -<h3 class="hndle"><span><?php _e('Rule of the column for a item name','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_item_indication');"><?php _e('(Explain)','usces'); ?></a></h3>
452 -<div class="inside">
453 -<table class="form_table">
454 - <tr>
455 - <th><label for="indi_item_name"><?php _e('Indication of item name','usces'); ?></label></th>
456 - <td><input name="indication[item_name]" type="checkbox" id="indi_item_name" value="<?php echo esc_attr($indi_item_name['item_name']); ?>"<?php echo $checked_item_name['item_name']; ?> /></td>
457 - <th><?php _e('Position of item name','usces'); ?></th>
458 - <td><input name="position[item_name]" type="text" class="num" id="pos_item_name" value="<?php echo esc_attr($pos_item_name['item_name']); ?>" />(<?php _e('numeric','usces'); ?>)</td>
459 - </tr>
460 - <tr>
461 - <th><label for="indi_item_code"><?php _e('Indication of item code','usces'); ?></label></th>
462 - <td><input name="indication[item_code]" type="checkbox" id="indi_item_code" value="<?php echo esc_attr($indi_item_name['item_code']); ?>"<?php echo $checked_item_name['item_code']; ?> /></td>
463 - <th><?php _e('Position of item code','usces'); ?></th>
464 - <td><input name="position[item_code]" type="text" class="num" id="pos_item_code" value="<?php echo esc_attr($pos_item_name['item_code']); ?>" />(<?php _e('numeric','usces'); ?>)</td>
465 - </tr>
466 - <tr>
467 - <th><label for="indi_sku_name"><?php _e('Indication of SKU name','usces'); ?></label></th>
468 - <td><input name="indication[sku_name]" type="checkbox" id="indi_sku_name" value="<?php echo esc_attr($indi_item_name['sku_name']); ?>"<?php echo $checked_item_name['sku_name']; ?> /></td>
469 - <th><?php _e('Position of SKU name','usces'); ?></th>
470 - <td><input name="position[sku_name]" type="text" class="num" id="pos_sku_name" value="<?php echo esc_attr($pos_item_name['sku_name']); ?>" />(<?php _e('numeric','usces'); ?>)</td>
471 - </tr>
472 - <tr>
473 - <th><label for="indi_sku_code"><?php _e('Indication of SKU code','usces'); ?></label></th>
474 - <td><input name="indication[sku_code]" type="checkbox" id="indi_sku_code" value="<?php echo esc_attr($indi_item_name['sku_code']); ?>"<?php echo $checked_item_name['sku_code']; ?> /></td>
475 - <th><?php _e('Position of SKU code','usces'); ?></th>
476 - <td><input name="position[sku_code]" type="text" class="num" id="pos_sku_code" value="<?php echo esc_attr($pos_item_name['sku_code']); ?>" />(<?php _e('numeric','usces'); ?>)</td>
477 - </tr>
478 -</table>
479 -<hr size="1" color="#CCCCCC" />
480 -<div id="ex_item_indication" class="explanation"><?php _e('You can appoint indication, non-indication, sort of the item name to show the cart.<br />This rule is applied as brand names such as a cart page, contents confirmation page, a member information purchase history, an email, a written estimate, the statement of delivery.','usces'); ?></div>
481 -</div>
482 -</div><!--postbox-->
483 -
484 -<!--20100809ysk start-->
523 + <div class="postbox">
524 + <h3><span><?php esc_html_e( 'Rule of the column for a item name', 'usces' ); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_item_indication');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></h3>
525 + <div class="inside">
526 + <table class="form_table">
527 + <tr>
528 + <th><label for="indi_item_name"><?php esc_html_e( 'Indication of item name', 'usces' ); ?></label></th>
529 + <td><input name="indication[item_name]" type="checkbox" id="indi_item_name" value="<?php echo esc_attr( $indi_item_name['item_name'] ); ?>"<?php echo esc_attr( $checked_item_name['item_name'] ); ?> /></td>
530 + <th><?php esc_html_e( 'Position of item name', 'usces' ); ?></th>
531 + <td><input name="position[item_name]" type="text" class="num" id="pos_item_name" value="<?php echo esc_attr( $pos_item_name['item_name'] ); ?>" />(<?php esc_html_e( 'numeric', 'usces' ); ?>)</td>
532 + </tr>
533 + <tr>
534 + <th><label for="indi_item_code"><?php esc_html_e( 'Indication of item code', 'usces' ); ?></label></th>
535 + <td><input name="indication[item_code]" type="checkbox" id="indi_item_code" value="<?php echo esc_attr( $indi_item_name['item_code'] ); ?>"<?php echo esc_attr( $checked_item_name['item_code'] ); ?> /></td>
536 + <th><?php esc_html_e( 'Position of item code', 'usces' ); ?></th>
537 + <td><input name="position[item_code]" type="text" class="num" id="pos_item_code" value="<?php echo esc_attr( $pos_item_name['item_code'] ); ?>" />(<?php esc_html_e( 'numeric', 'usces' ); ?>)</td>
538 + </tr>
539 + <tr>
540 + <th><label for="indi_sku_name"><?php esc_html_e( 'Indication of SKU name', 'usces' ); ?></label></th>
541 + <td><input name="indication[sku_name]" type="checkbox" id="indi_sku_name" value="<?php echo esc_attr( $indi_item_name['sku_name'] ); ?>"<?php echo esc_attr( $checked_item_name['sku_name'] ); ?> /></td>
542 + <th><?php esc_html_e( 'Position of SKU name', 'usces' ); ?></th>
543 + <td><input name="position[sku_name]" type="text" class="num" id="pos_sku_name" value="<?php echo esc_attr( $pos_item_name['sku_name'] ); ?>" />(<?php esc_html_e( 'numeric', 'usces' ); ?>)</td>
544 + </tr>
545 + <tr>
546 + <th><label for="indi_sku_code"><?php esc_html_e( 'Indication of SKU code', 'usces' ); ?></label></th>
547 + <td><input name="indication[sku_code]" type="checkbox" id="indi_sku_code" value="<?php echo esc_attr( $indi_item_name['sku_code'] ); ?>"<?php echo esc_attr( $checked_item_name['sku_code'] ); ?> /></td>
548 + <th><?php esc_html_e( 'Position of SKU code', 'usces' ); ?></th>
549 + <td><input name="position[sku_code]" type="text" class="num" id="pos_sku_code" value="<?php echo esc_attr( $pos_item_name['sku_code'] ); ?>" />(<?php esc_html_e( 'numeric', 'usces' ); ?>)</td>
550 + </tr>
551 + </table>
552 + <hr size="1" color="#CCCCCC" />
553 + <div id="ex_item_indication" class="explanation"><?php _e( 'You can appoint indication, non-indication, sort of the item name to show the cart.<br />This rule is applied as brand names such as a cart page, contents confirmation page, a member information purchase history, an email, a written estimate, the statement of delivery.', 'usces' ); ?></div>
554 + </div>
555 + </div><!--postbox-->
485 556 </div><!--cart_page_setting_1-->
486 557
487 558 <div id="cart_page_setting_2">
488 -<!--20100809ysk end-->
559 + <div class="postbox">
560 + <h3><span><?php esc_html_e( 'Explanation in a Cart page', 'usces' ); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_cart_page');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></h3>
561 + <div class="inside">
562 + <table class="form_table">
563 + <tr>
564 + <th><?php esc_html_e( 'header', 'usces' ); ?></th>
565 + <td><textarea name="header[cart]" id="header[cart]" class="textarea_fld"><?php wel_esc_script_e( $cart_header ); ?></textarea></td>
566 + <td>&nbsp;</td>
567 + </tr>
568 + <tr>
569 + <th><?php esc_html_e( 'footer', 'usces' ); ?></th>
570 + <td><textarea name="footer[cart]" id="footer[cart]" class="textarea_fld"><?php wel_esc_script_e( $cart_footer ); ?></textarea></td>
571 + <td>&nbsp;</td>
572 + </tr>
573 + </table>
574 + <hr size="1" color="#CCCCCC" />
575 + <div id="ex_cart_page" class="explanation"><?php esc_html_e( 'You can set additional explanation to insert in a cart page.', 'usces' ); ?></div>
576 + </div>
577 + </div><!--postbox-->
489 578
490 -<div class="postbox">
491 -<h3 class="hndle"><span><?php _e('Explanation in a Cart page','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_cart_page');"><?php _e('(Explain)','usces'); ?></a></h3>
492 -<div class="inside">
493 -<table class="form_table">
494 - <tr>
495 - <th><?php _e('header','usces'); ?></th>
496 - <td><textarea name="header[cart]" id="header[cart]" class="mail_header"><?php echo (isset($cart_page_datas['header']['cart']) ? $cart_page_datas['header']['cart'] : ''); ?></textarea></td>
497 - <td>&nbsp;</td>
498 - </tr>
499 - <tr>
500 - <th><?php _e('footer','usces'); ?></th>
501 - <td><textarea name="footer[cart]" id="footer[cart]" class="mail_footer"><?php echo (isset($cart_page_datas['footer']['cart']) ? $cart_page_datas['footer']['cart'] : ''); ?></textarea></td>
502 - <td>&nbsp;</td>
503 - </tr>
504 -</table>
505 -<hr size="1" color="#CCCCCC" />
506 -<div id="ex_cart_page" class="explanation"><?php _e('You can set additional explanation to insert in a cart page.','usces'); ?></div>
507 -</div>
508 -</div><!--postbox-->
579 + <div class="postbox">
580 + <h3><span><?php esc_html_e( 'Explanation in a Customer Info page', 'usces' ); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_customer_page');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></h3>
581 + <div class="inside">
582 + <table class="form_table">
583 + <tr>
584 + <th><?php esc_html_e( 'header', 'usces' ); ?></th>
585 + <td><textarea name="header[customer]" id="header[customer]" class="textarea_fld"><?php wel_esc_script_e( $customer_header ); ?></textarea></td>
586 + <td>&nbsp;</td>
587 + </tr>
588 + <tr>
589 + <th><?php esc_html_e( 'footer', 'usces' ); ?></th>
590 + <td><textarea name="footer[customer]" id="footer[customer]" class="textarea_fld"><?php wel_esc_script_e( $customer_footer ); ?></textarea></td>
591 + <td>&nbsp;</td>
592 + </tr>
593 + </table>
594 + <hr size="1" color="#CCCCCC" />
595 + <div id="ex_customer_page" class="explanation"><?php esc_html_e( 'You can set additional explanation to insert in a customer information page.', 'usces' ); ?></div>
596 + </div>
597 + </div><!--postbox-->
509 598
510 -<div class="postbox">
511 -<h3 class="hndle"><span><?php _e('Explanation in a Customer Info page','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_customer_page');"><?php _e('(Explain)','usces'); ?></a></h3>
512 -<div class="inside">
513 -<table class="form_table">
514 - <tr>
515 - <th><?php _e('header','usces'); ?></th>
516 - <td><textarea name="header[customer]" id="header[customer]" class="mail_header"><?php echo (isset($cart_page_datas['header']['customer']) ? $cart_page_datas['header']['customer'] : ''); ?></textarea></td>
517 - <td>&nbsp;</td>
518 - </tr>
519 - <tr>
520 - <th><?php _e('footer','usces'); ?></th>
521 - <td><textarea name="footer[customer]" id="footer[customer]" class="mail_footer"><?php echo (isset($cart_page_datas['footer']['customer']) ? $cart_page_datas['footer']['customer'] : ''); ?></textarea></td>
522 - <td>&nbsp;</td>
523 - </tr>
524 -</table>
525 -<hr size="1" color="#CCCCCC" />
526 -<div id="ex_customer_page" class="explanation"><?php _e('You can set additional explanation to insert in a customer information page.','usces'); ?></div>
527 -</div>
528 -</div><!--postbox-->
599 + <div class="postbox">
600 + <h3><span><?php esc_html_e( 'Explanation in Delivery and Payment method page', 'usces' ); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_delivery_page');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></h3>
601 + <div class="inside">
602 + <table class="form_table">
603 + <tr>
604 + <th><?php esc_html_e( 'header', 'usces' ); ?></th>
605 + <td><textarea name="header[delivery]" id="header[delivery]" class="textarea_fld"><?php wel_esc_script_e( $delivery_header ); ?></textarea></td>
606 + <td>&nbsp;</td>
607 + </tr>
608 + <tr>
609 + <th><?php esc_html_e( 'footer', 'usces' ); ?></th>
610 + <td><textarea name="footer[delivery]" id="footer[delivery]" class="textarea_fld"><?php wel_esc_script_e( $delivery_footer ); ?></textarea></td>
611 + <td>&nbsp;</td>
612 + </tr>
613 + </table>
614 + <hr size="1" color="#CCCCCC" />
615 + <div id="ex_delivery_page" class="explanation"><?php esc_html_e( 'You can set additional explanation to insert in a delivery and a payment method page.', 'usces' ); ?></div>
616 + </div>
617 + </div><!--postbox-->
529 618
530 -<div class="postbox">
531 -<h3 class="hndle"><span><?php _e('Explanation in Delivery and Payment method page','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_delivery_page');"><?php _e('(Explain)','usces'); ?></a></h3>
532 -<div class="inside">
533 -<table class="form_table">
534 - <tr>
535 - <th><?php _e('header','usces'); ?></th>
536 - <td><textarea name="header[delivery]" id="header[delivery]" class="mail_header"><?php echo $cart_page_datas['header']['delivery']; ?></textarea></td>
537 - <td>&nbsp;</td>
538 - </tr>
539 - <tr>
540 - <th><?php _e('footer','usces'); ?></th>
541 - <td><textarea name="footer[delivery]" id="footer[delivery]" class="mail_footer"><?php echo $cart_page_datas['footer']['delivery']; ?></textarea></td>
542 - <td>&nbsp;</td>
543 - </tr>
544 -</table>
545 -<hr size="1" color="#CCCCCC" />
546 -<div id="ex_delivery_page" class="explanation"><?php _e('You can set additional explanation to insert in a delivery and a payment method page.','usces'); ?></div>
547 -</div>
548 -</div><!--postbox-->
619 + <div class="postbox">
620 + <h3><span><?php esc_html_e( 'Explanation in a Confirm page', 'usces' ); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_confirm_page');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></h3>
621 + <div class="inside">
622 + <table class="form_table">
623 + <tr>
624 + <th><?php esc_html_e( 'header', 'usces' ); ?></th>
625 + <td><textarea name="header[confirm]" id="header[confirm]" class="textarea_fld"><?php wel_esc_script_e( $confirm_header ); ?></textarea></td>
626 + <td>&nbsp;</td>
627 + </tr>
628 + <tr>
629 + <th><?php esc_html_e( 'footer', 'usces' ); ?></th>
630 + <td><textarea name="footer[confirm]" id="footer[confirm]" class="textarea_fld"><?php wel_esc_script_e( $confirm_footer ); ?></textarea></td>
631 + <td>&nbsp;</td>
632 + </tr>
633 + </table>
634 + <hr size="1" color="#CCCCCC" />
635 + <div id="ex_confirm_page" class="explanation"><?php esc_html_e( 'You can set additional explanation to insert in a confirm page.', 'usces' ); ?></div>
636 + </div>
637 + </div><!--postbox-->
549 638
550 -<div class="postbox">
551 -<h3 class="hndle"><span><?php _e('Explanation in a Confirm page','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_confirm_page');"><?php _e('(Explain)','usces'); ?></a></h3>
552 -<div class="inside">
553 -<table class="form_table">
554 - <tr>
555 - <th><?php _e('header','usces'); ?></th>
556 - <td><textarea name="header[confirm]" id="header[confirm]" class="mail_header"><?php echo $cart_page_datas['header']['confirm']; ?></textarea></td>
557 - <td>&nbsp;</td>
558 - </tr>
559 - <tr>
560 - <th><?php _e('footer','usces'); ?></th>
561 - <td><textarea name="footer[confirm]" id="footer[confirm]" class="mail_footer"><?php echo $cart_page_datas['footer']['confirm']; ?></textarea></td>
562 - <td>&nbsp;</td>
563 - </tr>
564 -</table>
565 -<hr size="1" color="#CCCCCC" />
566 -<div id="ex_confirm_page" class="explanation"><?php _e('You can set additional explanation to insert in a confirm page.','usces'); ?></div>
567 -</div>
568 -</div><!--postbox-->
639 + <div class="postbox">
640 + <h3><span><?php esc_html_e( 'Explanation in a Completion page', 'usces' ); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_completion_page');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></h3>
641 + <div class="inside">
642 + <table class="form_table">
643 + <tr>
644 + <th><?php esc_html_e( 'header', 'usces' ); ?></th>
645 + <td><textarea name="header[completion]" id="header[completion]" class="textarea_fld"><?php wel_esc_script_e( $completion_header ); ?></textarea></td>
646 + <td>&nbsp;</td>
647 + </tr>
648 + <tr>
649 + <th><?php esc_html_e( 'footer', 'usces' ); ?></th>
650 + <td><textarea name="footer[completion]" id="footer[completion]" class="textarea_fld"><?php wel_esc_script_e( $completion_footer ); ?></textarea></td>
651 + <td>&nbsp;</td>
652 + </tr>
653 + </table>
654 + <hr size="1" color="#CCCCCC" />
655 + <div id="ex_completion_page" class="explanation"><?php esc_html_e( 'You can set additional explanation to insert in a completion page.', 'usces' ); ?></div>
656 + </div>
657 + </div><!--postbox-->
658 +</div><!--cart_page_setting_2-->
569 659
570 -<div class="postbox">
571 -<h3 class="hndle"><span><?php _e('Explanation in a Completion page','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_completion_page');"><?php _e('(Explain)','usces'); ?></a></h3>
572 -<div class="inside">
573 -<table class="form_table">
574 - <tr>
575 - <th><?php _e('header','usces'); ?></th>
576 - <td><textarea name="header[completion]" id="header[completion]" class="mail_header"><?php echo $cart_page_datas['header']['completion']; ?></textarea></td>
577 - <td>&nbsp;</td>
578 - </tr>
579 - <tr>
580 - <th><?php _e('footer','usces'); ?></th>
581 - <td><textarea name="footer[completion]" id="footer[completion]" class="mail_footer"><?php echo $cart_page_datas['footer']['completion']; ?></textarea></td>
582 - <td>&nbsp;</td>
583 - </tr>
584 -</table>
585 -<hr size="1" color="#CCCCCC" />
586 -<div id="ex_completion_page" class="explanation"><?php _e('You can set additional explanation to insert in a completion page.','usces'); ?></div>
587 -</div>
588 -</div><!--postbox-->
589 -
590 -<!--20100809ysk start-->
591 -</div><!--cart_page_setting_2-->
592 -<!--20100818ysk start-->
660 +<div id="cart_page_setting_6">
661 + <div class="postbox">
662 + <h3><span><?php esc_html_e( 'Matters Concerning Withdrawal or Cancellation of Application', 'usces' ); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_confirm_notes');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></h3>
663 + <div class="inside">
664 + <textarea name="confirm_notes" rows="10" cols="50" id="confirm_notes" class="large-text"><?php wel_esc_script_e( $confirm_notes ); ?></textarea>
665 + <hr size="1" color="#CCCCCC" />
666 + <div id="ex_confirm_notes" class="explanation"><?php esc_html_e( 'Information on how to contact the company for returns and cancellations, contact information, and conditions for returns and cancellations can be displayed on the confirmation page.', 'usces' ); ?></div>
667 + </div>
668 + </div><!--postbox-->
669 +</div><!--cart_page_setting_1-->
593 670 <?php
594 - //$meta = has_custom_order_meta();
595 - $csod_meta = usces_has_custom_field_meta('order');
596 - $csod_display = (empty($csod_meta)) ? ' style="display: none;"' : '';
597 - $csod_means = get_option('usces_custom_order_select');
598 - $csod_meansoption = '';
599 - foreach($csod_means as $meankey => $meanvalue) {
600 - $csod_meansoption .= '<option value="'.$meankey.'">'.$meanvalue."</option>\n";
601 - }
671 +$csod_meta = usces_has_custom_field_meta( 'order' );
672 +$csod_display = ( empty( $csod_meta ) ) ? ' style="display: none;"' : '';
673 +$csod_means = get_option( 'usces_custom_order_select' );
674 +$csod_meansoption = '';
675 +foreach ( $csod_means as $meankey => $meanvalue ) {
676 + $csod_meansoption .= '<option value="' . $meankey . '">' . $meanvalue . "</option>\n";
677 +}
602 678 ?>
603 679 <div id="cart_page_setting_3">
604 680 <div class="postbox">
605 - <h3 class="hndle"><span><?php _e('Custom order field', 'usces'); ?><a style="cursor:pointer;" onclick="toggleVisibility('ex_custom_order');"><?php _e('(Explain)','usces'); ?></a></span></h3>
606 -<!--20100818ysk end-->
681 + <h3><span><?php esc_html_e( 'Custom order field', 'usces' ); ?><a style="cursor:pointer;" onclick="toggleVisibility('ex_custom_order');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></span></h3>
607 682 <div class="inside">
608 -<!--20100818ysk start-->
609 683 <div id="postoptcustomstuff">
610 - <table id="csod-list-table" class="list"<?php echo $csod_display; ?>>
611 -<!--20100818ysk end-->
684 + <table id="csod-list-table" class="list"<?php echo esc_attr( $csod_display ); ?>>
612 685 <thead>
613 686 <tr>
614 - <th class="left"><?php _e('key name','usces') ?></th>
615 - <th rowspan="2"><?php _e('selected amount','usces') ?></th>
687 + <th class="left"><?php esc_html_e( 'key name', 'usces' ); ?></th>
688 + <th rowspan="2"><?php esc_html_e( 'selected amount', 'usces' ); ?></th>
616 689 </tr>
617 690 <tr>
618 - <th class="left"><?php _e('field name','usces') ?></th>
691 + <th class="left"><?php esc_html_e( 'field name', 'usces' ); ?></th>
619 692 </tr>
620 693 </thead>
621 -<!--20100818ysk start-->
622 694 <tbody id="csod-list">
623 -<!--20100818ysk end-->
624 695 <?php
625 - if(is_array($csod_meta)) {
626 - foreach($csod_meta as $key => $entry)
627 - echo _list_custom_order_meta_row($key, $entry);
696 +if ( is_array( $csod_meta ) ) {
697 + foreach ( $csod_meta as $key => $entry ) {
698 + echo _list_custom_order_meta_row( $key, $entry );
628 699 }
700 +}
629 701 ?>
630 702 </tbody>
631 703 </table>
632 704 <div id="ajax-response-csod"></div>
633 -<!--20100818ysk start-->
634 - <p><strong><?php _e('Add a new custom order field','usces') ?> : </strong></p>
635 -<!--20100818ysk end-->
705 + <p><strong><?php esc_html_e( 'Add a new custom order field', 'usces' ); ?> : </strong></p>
636 706 <table id="newmeta2">
637 707 <thead>
638 708 <tr>
639 - <th class="left"><?php _e('key name','usces') ?></th>
640 - <th rowspan="2"><?php _e('selected amount','usces') ?></th>
709 + <th class="left"><?php esc_html_e( 'key name', 'usces' ); ?></th>
710 + <th rowspan="2"><?php esc_html_e( 'selected amount', 'usces' ); ?></th>
641 711 </tr>
642 712 <tr>
643 - <th class="left"><?php _e('field name','usces') ?></th>
713 + <th class="left"><?php esc_html_e( 'field name', 'usces' ); ?></th>
644 714 </tr>
645 715 </thead>
646 716
647 717 <tbody>
648 718 <tr>
649 - <td class='item-opt-key'>
719 + <td class="item-opt-key">
650 720 <input type="text" name="newcsodkey" id="newcsodkey" class="optname" value="" />
651 721 <input type="text" name="newcsodname" id="newcsodname" class="optname" value="" />
652 - <div class="optcheck"><select name='newcsodmeans' id='newcsodmeans'><?php echo $csod_meansoption; ?></select>
653 - <input type="checkbox" name="newcsodessential" id="newcsodessential" /><label for='newcsodessential'><?php _e('Required','usces') ?></label></div>
722 + <div class="optcheck"><select name="newcsodmeans" id="newcsodmeans"><?php wel_esc_script_e( $csod_meansoption ); ?></select>
723 + <input type="checkbox" name="newcsodessential" id="newcsodessential" /><label for="newcsodessential"><?php esc_html_e( 'Required', 'usces' ); ?></label></div>
654 724 </td>
655 - <td class='item-opt-value'><textarea name="newcsodvalue" id="newcsodvalue" class='optvalue'></textarea></td>
725 + <td class="item-opt-value"><textarea name="newcsodvalue" id="newcsodvalue" class="optvalue"></textarea></td>
656 726 </tr>
657 727
658 728 <tr><td colspan="2" class="submit">
659 -<!--20100818ysk start-->
660 - <input type="button" name="add_csod" id="add_csod" value="<?php _e('Add custom order field','usces') ?>" onclick="customField.addOrder();" />
661 -<!--20100818ysk end-->
729 + <input type="button" class="button" name="add_csod" id="add_csod" value="<?php esc_attr_e( 'Add custom order field', 'usces' ); ?>" onclick="customField.addOrder();" />
662 730 <div id="newcsod_loading" class="meta_submit_loading"></div>
663 731 </td></tr>
664 732 </tbody>
665 733 </table>
@@ -664,79 +732,79 @@
664 732 </tbody>
665 733 </table>
666 734
667 735 <hr size="1" color="#CCCCCC" />
668 - <div id="ex_custom_order" class="explanation"><?php _e("You can add an arbitrary field to the page of the payment method.", 'usces'); ?></div>
736 + <div id="ex_custom_order" class="explanation"><?php esc_html_e( 'You can add an arbitrary field to the page of the payment method.', 'usces' ); ?></div>
669 737 </div>
670 738 </div>
671 739 </div><!--postbox-->
672 740 </div><!--cart_page_setting_3-->
673 -<!--20100818ysk start-->
674 741 <?php
675 - $cscs_meta = usces_has_custom_field_meta('customer');
676 - $cscs_display = (empty($cscs_meta)) ? ' style="display: none;"' : '';
677 - $cscs_means = get_option('usces_custom_customer_select');
678 - $cscs_meansoption = '';
679 - foreach($cscs_means as $meankey => $meanvalue) {
680 - $cscs_meansoption .= '<option value="'.$meankey.'">'.$meanvalue."</option>\n";
681 - }
682 - $positions = get_option('usces_custom_field_position_select');
683 - $positionsoption = '';
684 - foreach($positions as $poskey => $posvalue) {
685 - $positionsoption .= '<option value="'.$poskey.'">'.$posvalue."</option>\n";
686 - }
742 +$cscs_meta = usces_has_custom_field_meta( 'customer' );
743 +$cscs_display = ( empty( $cscs_meta ) ) ? ' style="display: none;"' : '';
744 +$cscs_means = get_option( 'usces_custom_customer_select' );
745 +$cscs_meansoption = '';
746 +foreach ( $cscs_means as $meankey => $meanvalue ) {
747 + $cscs_meansoption .= '<option value="' . $meankey . '">' . $meanvalue . "</option>\n";
748 +}
749 +$positions = get_option( 'usces_custom_field_position_select' );
750 +$positionsoption = '';
751 +foreach ( $positions as $poskey => $posvalue ) {
752 + $positionsoption .= '<option value="' . $poskey . '">' . $posvalue . "</option>\n";
753 +}
687 754 ?>
688 755 <div id="cart_page_setting_4">
689 756 <div class="postbox">
690 - <h3 class="hndle"><span><?php _e('Custom customer field', 'usces'); ?><a style="cursor:pointer;" onclick="toggleVisibility('ex_custom_customer');"><?php _e('(Explain)','usces'); ?></a></span></h3>
757 + <h3><span><?php esc_html_e( 'Custom customer field', 'usces' ); ?><a style="cursor:pointer;" onclick="toggleVisibility('ex_custom_customer');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></span></h3>
691 758 <div class="inside">
692 759 <div id="postoptcustomstuff">
693 - <table id="cscs-list-table" class="list"<?php echo $cscs_display; ?>>
760 + <table id="cscs-list-table" class="list"<?php echo esc_attr( $cscs_display ); ?>>
694 761 <thead>
695 762 <tr>
696 - <th class="left"><?php _e('key name','usces') ?></th>
697 - <th rowspan="2"><?php _e('selected amount','usces') ?></th>
763 + <th class="left"><?php esc_html_e( 'key name', 'usces' ); ?></th>
764 + <th rowspan="2"><?php esc_html_e( 'selected amount', 'usces' ); ?></th>
698 765 </tr>
699 766 <tr>
700 - <th class="left"><?php _e('field name','usces') ?></th>
767 + <th class="left"><?php esc_html_e( 'field name', 'usces' ); ?></th>
701 768 </tr>
702 769 </thead>
703 770 <tbody id="cscs-list">
704 771 <?php
705 - if(is_array($cscs_meta)) {
706 - foreach($cscs_meta as $key => $entry)
707 - echo _list_custom_customer_meta_row($key, $entry);
772 +if ( is_array( $cscs_meta ) ) {
773 + foreach ( $cscs_meta as $key => $entry ) {
774 + echo _list_custom_customer_meta_row( $key, $entry );
708 775 }
776 +}
709 777 ?>
710 778 </tbody>
711 779 </table>
712 780 <div id="ajax-response-cscs"></div>
713 - <p><strong><?php _e('Add a new custom customer field','usces') ?> : </strong></p>
781 + <p><strong><?php esc_html_e( 'Add a new custom customer field', 'usces' ); ?> : </strong></p>
714 782 <table id="newmeta2">
715 783 <thead>
716 784 <tr>
717 - <th class="left"><?php _e('key name','usces') ?></th>
718 - <th rowspan="2"><?php _e('selected amount','usces') ?></th>
785 + <th class="left"><?php esc_html_e( 'key name', 'usces' ); ?></th>
786 + <th rowspan="2"><?php esc_html_e( 'selected amount', 'usces' ); ?></th>
719 787 </tr>
720 788 <tr>
721 - <th class="left"><?php _e('field name','usces') ?></th>
789 + <th class="left"><?php esc_html_e( 'field name', 'usces' ); ?></th>
722 790 </tr>
723 791 </thead>
724 792
725 793 <tbody>
726 794 <tr>
727 - <td class='item-opt-key'>
795 + <td class="item-opt-key">
728 796 <input type="text" name="newcscskey" id="newcscskey" class="optname" value="" />
729 797 <input type="text" name="newcscsname" id="newcscsname" class="optname" value="" />
730 - <div class="optcheck"><select name='newcscsmeans' id='newcscsmeans'><?php echo $cscs_meansoption; ?></select>
731 - <input type="checkbox" name="newcscsessential" id="newcscsessential" /><label for='newcscsessential'><?php _e('Required','usces') ?></label>
732 - <select name='newcscsposition' id='newcscsposition'><?php echo $positionsoption; ?></select></div>
798 + <div class="optcheck"><select name="newcscsmeans" id="newcscsmeans"><?php wel_esc_script_e( $cscs_meansoption ); ?></select>
799 + <input type="checkbox" name="newcscsessential" id="newcscsessential" /><label for="newcscsessential"><?php esc_html_e( 'Required', 'usces' ); ?></label>
800 + <select name="newcscsposition" id="newcscsposition"><?php wel_esc_script_e( $positionsoption ); ?></select></div>
733 801 </td>
734 - <td class='item-opt-value'><textarea name="newcscsvalue" id="newcscsvalue" class='optvalue'></textarea></td>
802 + <td class="item-opt-value"><textarea name="newcscsvalue" id="newcscsvalue" class="optvalue"></textarea></td>
735 803 </tr>
736 804
737 805 <tr><td colspan="2" class="submit">
738 - <input type="button" name="add_cscs" id="add_cscs" value="<?php _e('Add custom customer field','usces') ?>" onclick="customField.addCustomer();" />
806 + <input type="button" class="button" name="add_cscs" id="add_cscs" value="<?php esc_attr_e( 'Add custom customer field', 'usces' ); ?>" onclick="customField.addCustomer();" />
739 807 <div id="newcscs_loading" class="meta_submit_loading"></div>
740 808 </td></tr>
741 809 </tbody>
742 810 </table>
@@ -741,73 +809,74 @@
741 809 </tbody>
742 810 </table>
743 811
744 812 <hr size="1" color="#CCCCCC" />
745 - <div id="ex_custom_customer" class="explanation"><?php _e("You can add an arbitrary field to customer information.", 'usces'); ?></div>
813 + <div id="ex_custom_customer" class="explanation"><?php esc_html_e( 'You can add an arbitrary field to customer information.', 'usces' ); ?></div>
746 814 </div>
747 815 </div>
748 816 </div><!--postbox-->
749 817 </div><!--cart_page_setting_4-->
750 818 <?php
751 - $csde_meta = usces_has_custom_field_meta('delivery');
752 - $csde_display = (empty($csde_meta)) ? ' style="display: none;"' : '';
753 - $csde_means = get_option('usces_custom_delivery_select');
754 - $csde_meansoption = '';
755 - foreach($csde_means as $meankey => $meanvalue) {
756 - $csde_meansoption .= '<option value="'.$meankey.'">'.$meanvalue."</option>\n";
757 - }
819 +$csde_meta = usces_has_custom_field_meta( 'delivery' );
820 +$csde_display = ( empty( $csde_meta ) ) ? ' style="display: none;"' : '';
821 +$csde_means = get_option( 'usces_custom_delivery_select' );
822 +$csde_meansoption = '';
823 +foreach ( $csde_means as $meankey => $meanvalue ) {
824 + $csde_meansoption .= '<option value="' . $meankey . '">' . $meanvalue . "</option>\n";
825 +}
758 826 ?>
759 827 <div id="cart_page_setting_5">
760 828 <div class="postbox">
761 - <h3 class="hndle"><span><?php _e('Custom delivery field', 'usces'); ?><a style="cursor:pointer;" onclick="toggleVisibility('ex_custom_delivery');"><?php _e('(Explain)','usces'); ?></a></span></h3>
829 + <h3><span><?php esc_html_e( 'Custom delivery field', 'usces' ); ?><a style="cursor:pointer;" onclick="toggleVisibility('ex_custom_delivery');"><?php esc_html_e( '(Explain)', 'usces' ); ?></a></span></h3>
762 830 <div class="inside">
763 831 <div id="postoptcustomstuff">
764 - <table id="csde-list-table" class="list"<?php echo $csde_display; ?>>
832 + <table id="csde-list-table" class="list"<?php echo esc_attr( $csde_display ); ?>>
765 833 <thead>
766 834 <tr>
767 - <th class="left"><?php _e('key name','usces') ?></th>
768 - <th rowspan="2"><?php _e('selected amount','usces') ?></th>
835 + <th class="left"><?php esc_html_e( 'key name', 'usces' ); ?></th>
836 + <th rowspan="2"><?php esc_html_e( 'selected amount', 'usces' ); ?></th>
769 837 </tr>
770 838 <tr>
771 - <th class="left"><?php _e('field name','usces') ?></th>
839 + <th class="left"><?php esc_html_e( 'field name', 'usces' ); ?></th>
772 840 </tr>
773 841 </thead>
774 842 <tbody id="csde-list">
775 843 <?php
776 - if(is_array($csde_meta)) {
777 - foreach($csde_meta as $key => $entry)
778 - echo _list_custom_delivery_meta_row($key, $entry);
844 +if ( is_array( $csde_meta ) ) {
845 + foreach ( $csde_meta as $key => $entry ) {
846 + echo _list_custom_delivery_meta_row( $key, $entry );
779 847 }
848 +}
780 849 ?>
781 850 </tbody>
782 851 </table>
783 852 <div id="ajax-response-csde"></div>
784 - <p><strong><?php _e('Add a new custom delivery field','usces') ?> : </strong></p>
853 + <p><strong><?php esc_html_e( 'Add a new custom delivery field', 'usces' ); ?> : </strong></p>
785 854 <table id="newmeta2">
786 855 <thead>
787 856 <tr>
788 - <th class="left"><?php _e('key name','usces') ?></th>
789 - <th rowspan="2"><?php _e('selected amount','usces') ?></th>
857 + <th class="left"><?php esc_html_e( 'key name', 'usces' ); ?></th>
858 + <th rowspan="2"><?php esc_html_e( 'selected amount', 'usces' ); ?></th>
790 859 </tr>
791 860 <tr>
792 - <th class="left"><?php _e('field name','usces') ?></th>
861 + <th class="left"><?php esc_html_e( 'field name', 'usces' ); ?></th>
793 862 </tr>
794 863 </thead>
795 864
796 865 <tbody>
797 866 <tr>
798 - <td class='item-opt-key'>
867 + <td class="item-opt-key">
799 868 <input type="text" name="newcsdekey" id="newcsdekey" class="optname" value="" />
800 869 <input type="text" name="newcsdename" id="newcsdename" class="optname" value="" />
801 - <div class="optcheck"><select name='newcsdemeans' id='newcsdemeans'><?php echo $csde_meansoption; ?></select>
802 - <input type="checkbox" name="newcsdeessential" id="newcsdeessential" /><label for='newcsdeessential'><?php _e('Required','usces') ?></label>
803 - <select name='newcsdeposition' id='newcsdeposition'><?php echo $positionsoption; ?></select></div>
870 + <div class="optcheck"><select name="newcsdemeans" id="newcsdemeans"><?php wel_esc_script_e( $csde_meansoption ); ?></select>
871 + <input type="checkbox" name="newcsdeessential" id="newcsdeessential" /><label for="newcsdeessential"><?php esc_html_e( 'Required', 'usces' ); ?></label>
872 + <select name="newcsdeposition" id="newcsdeposition"><?php wel_esc_script_e( $positionsoption ); ?></select></div>
804 873 </td>
805 - <td class='item-opt-value'><textarea name="newcsdevalue" id="newcsdevalue" class='optvalue'></textarea></td>
874 + <td class="item-opt-value"><textarea name="newcsdevalue" id="newcsdevalue" class="optvalue"></textarea></td>
806 875 </tr>
807 876
808 877 <tr><td colspan="2" class="submit">
809 - <input type="button" name="add_csde" id="add_csde" value="<?php _e('Add custom delivery field','usces') ?>" onclick="customField.addDelivery();" />
878 + <input type="button" class="button" name="add_csde" id="add_csde" value="<?php esc_attr_e( 'Add custom delivery field', 'usces' ); ?>" onclick="customField.addDelivery();" />
810 879 <div id="newcsde_loading" class="meta_submit_loading"></div>
811 880 </td></tr>
812 881 </tbody>
813 882 </table>
@@ -812,18 +881,17 @@
812 881 </tbody>
813 882 </table>
814 883
815 884 <hr size="1" color="#CCCCCC" />
816 - <div id="ex_custom_delivery" class="explanation"><?php _e("You can add an arbitrary field to delivery information.", 'usces'); ?></div>
885 + <div id="ex_custom_delivery" class="explanation"><?php esc_html_e( 'You can add an arbitrary field to delivery information.', 'usces' ); ?></div>
817 886 </div>
818 887 </div>
819 888 </div><!--postbox-->
820 889 </div><!--cart_page_setting_5-->
821 -</div><!--tabs-->
822 -<!--20100809ysk end-->
823 -<!--20100818ysk end-->
824 -
890 +<?php do_action( 'usces_action_admin_cart_tab_body' ); ?>
891 +</div><!--uscestabs_cart-->
825 892 </div><!--poststuff-->
826 -<input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
893 +<input name="usces_option_update" type="submit" class="button button-primary" value="<?php esc_attr_e( 'change decision', 'usces' ); ?>" />
894 +<?php wp_nonce_field( 'admin_cart', 'wc_nonce' ); ?>
827 895 </form>
828 896 </div><!--usces_admin-->
829 -</div><!--wrap-->
897 +</div><!--wrap-->