Commit 51a6a7d7 by Pham Huy

update checkout

parent 07a8c00b
......@@ -68,55 +68,55 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
jQuery(document).ready(function ( $ ) {
var loading = $('.loading');
var noti = $('.notify-mst');
$( 'i#search-taxcode' ).on( 'click', function() {
// $( 'i#search-taxcode' ).on( 'click', function() {
$(this).append(loading);
$('#mst_checkout_field_field').append(noti);
var taxcode = $('input#mst_checkout_field').val();
$('input#mst_checkout_field').val(taxcode.trim());
$.ajax({
url: "http://edupham.com/api/v1/get-company-info-by-taxcode",
data: {
"taxcode": taxcode
},
dataType: "json",
type: 'GET',
beforeSend: function () {
$('.loading').css('display','block');
},
success: function( response ) {
$('.loading').css('display','none');
// console.log(response);
if (response.code == 400) {
noti.text(response.message);
noti.css('display','block');
$( 'input#billing_company' ).val('');
$( 'input#billing_city' ).val('');
}
if (response.code == 200) {
var info = response.data;
noti.css('display','none');
noti.remove();
}
// $(this).append(loading);
// $('#mst_checkout_field_field').append(noti);
// var taxcode = $('input#mst_checkout_field').val();
// $('input#mst_checkout_field').val(taxcode.trim());
// $.ajax({
// url: "http://edupham.com/api/v1/get-company-info-by-taxcode",
// data: {
// "taxcode": taxcode
// },
// dataType: "json",
// type: 'GET',
// beforeSend: function () {
// $('.loading').css('display','block');
// },
// success: function( response ) {
// $('.loading').css('display','none');
// // console.log(response);
// if (response.code == 400) {
// noti.text(response.message);
// noti.css('display','block');
// $( 'input#billing_company' ).val('');
// $( 'input#billing_city' ).val('');
// }
// if (response.code == 200) {
// var info = response.data;
// noti.css('display','none');
// noti.remove();
// }
if ( info ) {
// $( 'input#_billing_first_name' ).val( info.Title );
// $( 'input#_billing_last_name' ).val( info.billing_last_name );
$( 'input#billing_company' ).val( info.Title );
// $( 'input#_billing_address_1' ).val( info.billing_address_1 );
// $( 'input#_billing_address_2' ).val( info.billing_address_2 );
$( 'input#billing_city' ).val( info.TinhThanhTitle );
// $( '#_billing_country' ).val( info.billing_country );
// $( 'input#_billing_state' ).val( info.billing_state );
// $( 'input#_billing_email' ).val( info.billing_email );
// $( 'input#_billing_phone' ).val( info.billing_phone );
// $( 'input#_billing_vat' ).val( info.billing_vat );
}
// if ( info ) {
// // $( 'input#_billing_first_name' ).val( info.Title );
// // $( 'input#_billing_last_name' ).val( info.billing_last_name );
// $( 'input#billing_company' ).val( info.Title );
// // $( 'input#_billing_address_1' ).val( info.billing_address_1 );
// // $( 'input#_billing_address_2' ).val( info.billing_address_2 );
// $( 'input#billing_city' ).val( info.TinhThanhTitle );
// // $( '#_billing_country' ).val( info.billing_country );
// // $( 'input#_billing_state' ).val( info.billing_state );
// // $( 'input#_billing_email' ).val( info.billing_email );
// // $( 'input#_billing_phone' ).val( info.billing_phone );
// // $( 'input#_billing_vat' ).val( info.billing_vat );
// }
$( '.edit_address' ).unblock();
}
});
});
// $( '.edit_address' ).unblock();
// }
// });
// });
});
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment