| 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> </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> </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> </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> </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> </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> </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> </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> </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> </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> </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--> |
| 898 |
|