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