Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ahoadon
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Quang Huy
ahoadon
Commits
be640cd4
Commit
be640cd4
authored
Feb 12, 2020
by
Pham Huy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add style loading icon
parent
bc677d21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
hdv-huypq.css
wp-content/themes/ahoadonviet/css/hdv-huypq.css
+6
-0
form-checkout.php
...themes/ahoadonviet/woocommerce/checkout/form-checkout.php
+8
-6
No files found.
wp-content/themes/ahoadonviet/css/hdv-huypq.css
View file @
be640cd4
...
...
@@ -332,3 +332,9 @@ p.title-item-sidebar {
background
:
#56BC86
;
border-color
:
#56BC86
;
}
.woocommerce
form
[
name
=
"checkout"
]
.loading
{
position
:
absolute
;
left
:
calc
(
50%
-
100px
);
top
:
0
;
}
wp-content/themes/ahoadonviet/woocommerce/checkout/form-checkout.php
View file @
be640cd4
...
...
@@ -69,7 +69,7 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
var
loading
=
$
(
'.loading'
);
var
noti
=
$
(
'.notify-mst'
);
$
(
'i#search-taxcode'
).
on
(
'click'
,
function
()
{
$
(
this
).
append
(
loading
);
$
(
'#mst_checkout_field'
).
append
(
loading
);
$
(
'#mst_checkout_field_field'
).
append
(
noti
);
var
taxcode
=
$
(
'input#mst_checkout_field'
).
val
();
$
(
'input#mst_checkout_field'
).
val
(
taxcode
.
trim
());
...
...
@@ -77,12 +77,12 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
if
(
taxcode
.
length
<
1
){
noti
.
text
(
'Mã số thuế không hợp lệ'
);
noti
.
css
(
'display'
,
'block'
);
$
(
'.loading'
)
.
css
(
'display'
,
'none'
);
loading
.
css
(
'display'
,
'none'
);
}
else
{
if
(
!
$
.
isNumeric
(
taxcode
))
{
noti
.
text
(
'Mã số thuế không hợp lệ'
);
noti
.
css
(
'display'
,
'block'
);
$
(
'.loading'
)
.
css
(
'display'
,
'none'
);
loading
.
css
(
'display'
,
'none'
);
}
else
{
$
.
ajax
({
url
:
"
<?=
get_site_url
()
?>
/wp-json/ahoadon/v1/taxcode/"
+
taxcode
,
...
...
@@ -92,10 +92,12 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
dataType
:
"json"
,
type
:
'GET'
,
beforeSend
:
function
()
{
$
(
'.loading'
).
css
(
'display'
,
'block'
);
loading
.
css
(
'display'
,
'block'
);
$
(
'i#search-taxcode'
).
css
(
'display'
,
'none'
);
},
success
:
function
(
response
)
{
$
(
'.loading'
).
css
(
'display'
,
'none'
);
loading
.
css
(
'display'
,
'none'
);
$
(
'i#search-taxcode'
).
css
(
'display'
,
'block'
);
// console.log(response);
if
(
response
.
status
==
400
)
{
noti
.
text
(
response
.
message
);
...
...
@@ -127,7 +129,7 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
error
:
function
(
xhr
,
ajaxOptions
,
thrownError
)
{
noti
.
text
(
'Mã số thuế không hợp lệ'
);
noti
.
css
(
'display'
,
'block'
);
$
(
'.loading'
)
.
css
(
'display'
,
'none'
);
loading
.
css
(
'display'
,
'none'
);
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment