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
07a8c00b
Commit
07a8c00b
authored
Feb 11, 2020
by
Pham Huy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update template checkout
parent
b9d6269a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
18 deletions
+95
-18
hdv-huypq.css
wp-content/themes/ahoadonviet/css/hdv-huypq.css
+1
-1
functions.php
wp-content/themes/ahoadonviet/functions.php
+10
-0
rolling-1s-200px.gif
wp-content/themes/ahoadonviet/images/rolling-1s-200px.gif
+0
-0
homepage-tpl.php
...ontent/themes/ahoadonviet/template-parts/homepage-tpl.php
+1
-0
price-tpl.php
wp-content/themes/ahoadonviet/template-parts/price-tpl.php
+24
-17
form-checkout.php
...themes/ahoadonviet/woocommerce/checkout/form-checkout.php
+59
-0
No files found.
wp-content/themes/ahoadonviet/css/hdv-huypq.css
View file @
07a8c00b
...
@@ -321,7 +321,7 @@ p.title-item-sidebar {
...
@@ -321,7 +321,7 @@ p.title-item-sidebar {
.woocommerce
#search-taxcode
{
.woocommerce
#search-taxcode
{
position
:
absolute
;
position
:
absolute
;
cursor
:
pointer
;
cursor
:
pointer
;
top
:
65%
;
top
:
3.8em
;
right
:
2%
;
right
:
2%
;
}
}
...
...
wp-content/themes/ahoadonviet/functions.php
View file @
07a8c00b
...
@@ -1031,6 +1031,16 @@ function custom_override_checkout_fields( $fields ) {
...
@@ -1031,6 +1031,16 @@ function custom_override_checkout_fields( $fields ) {
return
$fields
;
return
$fields
;
}
}
/**
* Add the fields to order email
*/
add_filter
(
'woocommerce_email_order_meta_keys'
,
'custom_checkout_field_order_meta_keys'
);
function
custom_checkout_field_order_meta_keys
(
$keys
)
{
echo
'<h4>Mã số thuế:</h4>'
;
$keys
[
'Taxcode'
]
=
'mst_checkout_field'
;
return
$keys
;
}
// add_filter( 'woocommerce_add_to_cart_validation', 'wc_limit_one_per_order', 10, 2 );
// add_filter( 'woocommerce_add_to_cart_validation', 'wc_limit_one_per_order', 10, 2 );
// function wc_limit_one_per_order( $passed_validation) {
// function wc_limit_one_per_order( $passed_validation) {
// if ( WC()->cart->get_cart_contents_count() >= 1 ) {
// if ( WC()->cart->get_cart_contents_count() >= 1 ) {
...
...
wp-content/themes/ahoadonviet/images/rolling-1s-200px.gif
0 → 100644
View file @
07a8c00b
50.3 KB
wp-content/themes/ahoadonviet/template-parts/homepage-tpl.php
View file @
07a8c00b
...
@@ -143,6 +143,7 @@ get_header();
...
@@ -143,6 +143,7 @@ get_header();
<div
class=
"row text-center price_fee"
>
<div
class=
"row text-center price_fee"
>
<div
class=
"col-xs-12 col-sm-12 col-md-12 col-lg-12 wow zoomIn"
>
<div
class=
"col-xs-12 col-sm-12 col-md-12 col-lg-12 wow zoomIn"
>
<p
class=
"txt-red"
>
PHÍ KHỞI TẠO: 500.000 VNĐ
</p>
<p
class=
"txt-red"
>
PHÍ KHỞI TẠO: 500.000 VNĐ
</p>
<p
style=
"font-size:16px"
>
(Áp dụng cho lần đầu tiên)
</p>
<p>
Phí chưa bao gồm VAT 10%
</p>
<p>
Phí chưa bao gồm VAT 10%
</p>
</div>
</div>
</div>
</div>
...
...
wp-content/themes/ahoadonviet/template-parts/price-tpl.php
View file @
07a8c00b
...
@@ -14,10 +14,10 @@ get_header();
...
@@ -14,10 +14,10 @@ get_header();
<section
id=
"prices"
>
<section
id=
"prices"
>
<div
class=
"container"
>
<div
class=
"container"
>
<h2
class=
"prices-title"
>
BẢNG GIÁ
PHẦN MỀM
A HÓA ĐƠN
</h2>
<h2
class=
"prices-title"
>
BẢNG GIÁ
GÓI HÓA ĐƠN ĐIỆN TỬ-
A HÓA ĐƠN
</h2>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-xs-12 col-sm-12 col-md-12 col-lg-12"
>
<div
class=
"col-xs-12 col-sm-12 col-md-12 col-lg-12"
>
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
id=
"package-invoice"
>
<thead>
<thead>
<tr>
<tr>
<th
scope=
"col"
width=
"7%"
class=
"text-center"
>
STT
</th>
<th
scope=
"col"
width=
"7%"
class=
"text-center"
>
STT
</th>
...
@@ -83,8 +83,8 @@ get_header();
...
@@ -83,8 +83,8 @@ get_header();
?>
?>
<tr>
<tr>
<th
scope=
"row"
class=
"text-center"
>
<?=
$stt
?>
</th>
<th
scope=
"row"
class=
"text-center"
>
<?=
$stt
?>
</th>
<td>
<?php
the_title
();
?>
</td>
<td
class=
"package-name"
>
<?php
the_title
();
?>
</td>
<td
class=
"text-right"
>
<?php
echo
number_format
(
$product
->
price
,
0
,
','
,
'.'
)
?>
</td>
<td
class=
"text-right
package-price
"
>
<?php
echo
number_format
(
$product
->
price
,
0
,
','
,
'.'
)
?>
</td>
<?php
if
(
$stt
==
1
)
{
?>
<?php
if
(
$stt
==
1
)
{
?>
<td
rowspan=
"
<?=
$product_cat
->
count
?>
"
class=
"text-right"
style=
"display: table-cell;vertical-align: middle;"
>
<?=
number_format
(
$fee_start
,
0
,
','
,
'.'
)
?>
</td>
<td
rowspan=
"
<?=
$product_cat
->
count
?>
"
class=
"text-right"
style=
"display: table-cell;vertical-align: middle;"
>
<?=
number_format
(
$fee_start
,
0
,
','
,
'.'
)
?>
</td>
<td
class=
"text-right"
>
<?php
echo
number_format
(
$product
->
price
+
$fee_start
,
0
,
','
,
'.'
)
?>
</td>
<td
class=
"text-right"
>
<?php
echo
number_format
(
$product
->
price
+
$fee_start
,
0
,
','
,
'.'
)
?>
</td>
...
@@ -92,7 +92,7 @@ get_header();
...
@@ -92,7 +92,7 @@ get_header();
<a
href=
"
<?php
echo
wc_get_cart_url
()
.
do_shortcode
(
'[add_to_cart_url id="'
.
$product
->
ID
.
'"]'
)
?>
"
class=
"btn btn-primary bg-light-green"
>
Mua ngay
</a>
<a
href=
"
<?php
echo
wc_get_cart_url
()
.
do_shortcode
(
'[add_to_cart_url id="'
.
$product
->
ID
.
'"]'
)
?>
"
class=
"btn btn-primary bg-light-green"
>
Mua ngay
</a>
</td></tr>
</td></tr>
<?php
continue
;
}
?>
<?php
continue
;
}
?>
<td
class=
"text-right"
>
<?php
echo
number_format
(
$product
->
price
+
$fee_start
,
0
,
','
,
'.'
)
?>
</td>
<td
class=
"text-right
total-price
"
>
<?php
echo
number_format
(
$product
->
price
+
$fee_start
,
0
,
','
,
'.'
)
?>
</td>
<td
class=
"text-center"
>
<td
class=
"text-center"
>
<a
href=
"
<?php
echo
wc_get_cart_url
()
.
do_shortcode
(
'[add_to_cart_url id="'
.
$product
->
ID
.
'"]'
)
?>
"
class=
"btn btn-primary bg-light-green"
>
Mua ngay
</a>
<a
href=
"
<?php
echo
wc_get_cart_url
()
.
do_shortcode
(
'[add_to_cart_url id="'
.
$product
->
ID
.
'"]'
)
?>
"
class=
"btn btn-primary bg-light-green"
>
Mua ngay
</a>
</td>
</td>
...
@@ -123,7 +123,7 @@ get_header();
...
@@ -123,7 +123,7 @@ get_header();
<h2 class="
prices
-
title
">BẢNG GIÁ GÓI CHỮ KÝ SỐ</h2>
<h2 class="
prices
-
title
">BẢNG GIÁ GÓI CHỮ KÝ SỐ</h2>
<div class="
row
">
<div class="
row
">
<div class="
col
-
xs
-
12
col
-
sm
-
12
col
-
md
-
12
col
-
lg
-
12
">
<div class="
col
-
xs
-
12
col
-
sm
-
12
col
-
md
-
12
col
-
lg
-
12
">
<table class="
table
table
-
striped
">
<table class="
table
table
-
striped
"
id="
digitalKey
"
>
<thead>
<thead>
<tr>
<tr>
<!-- <th scope="
col
" width="
7
%
" class="
text
-
center
">STT</th> -->
<!-- <th scope="
col
" width="
7
%
" class="
text
-
center
">STT</th> -->
...
@@ -175,7 +175,7 @@ get_header();
...
@@ -175,7 +175,7 @@ get_header();
if (
$products_digital->have_posts
() ) :
if (
$products_digital->have_posts
() ) :
$stt_1
= 0;
$stt_1
= 0;
$token
=
get_option('ext_cst_amount') ? get_option('ext_cst_amount') :
0;
$token
= 0;
?>
?>
<tbody>
<tbody>
</pre>
</pre>
...
@@ -190,24 +190,31 @@ get_header();
...
@@ -190,24 +190,31 @@ get_header();
// echo "
<
pre
>
";
// echo "
<
pre
>
";
// print_r(
$product
);
// print_r(
$product
);
$product_cat
= get_term(
$product->category_ids
[0], 'product_cat' );
$product_cat
= get_term(
$product->category_ids
[0], 'product_cat' );
$wcdpd_settings
= get_option('rp_wcdpd_settings');
foreach (
$wcdpd_settings
as
$wcdpd_set
) {
if (
$wcdpd_set['product_pricing'][0]['pricing_value']
) {
$token
=
$wcdpd_set['product_pricing'][0]['pricing_value']
;
}
}
$stt_1
++;
$stt_1
++;
?>
?>
<tr>
<tr>
<!-- <th scope="
row
"class="
text
-
center
"><?=
$stt_1
?></th> -->
<!-- <th scope="
row
"class="
text
-
center
"><?=
$stt_1
?></th> -->
<td><?php the_title(); ?></td>
<td
class="
packege
-
digitalkey
"
><?php the_title(); ?></td>
<td class="
text
-
right
"><?php echo number_format(
$price_excl_tax
, 0, ',', '.')?></td>
<td class="
text
-
right
"><?php echo number_format(
$price_excl_tax
, 0, ',', '.')?></td>
<?php if(
$stt_1
== 3){
<?php if(
$stt_1
== 3){
$tax_amount
= (
$price_excl_tax
)*10/100; // VAT amount?>
$tax_amount
= (
$price_excl_tax
)*10/100; // VAT amount?>
<td class="
text
-
right
"><?php echo number_format(0, 0, ',', '.')?></td>
<td class="
text
-
right
token
-
price
"><?php echo number_format(0, 0, ',', '.')?></td>
<td class="
text
-
right
"><?php echo number_format(
$price_excl_tax
, 0, ',', '.')?></td>
<td class="
text
-
right
price
-
excl
-
tax
"><?php echo number_format(
$price_excl_tax
, 0, ',', '.')?></td>
<td class="
text
-
right
"><?php echo number_format(
$tax_amount
, 0, ',', '.')?></td>
<td class="
text
-
right
tax
-
amount
"><?php echo number_format(
$tax_amount
, 0, ',', '.')?></td>
<td class="
text
-
right
"><?php echo number_format(
$price_incl_tax
, 0, ',', '.')?></td>
<td class="
text
-
right
price
-
total2
"><?php echo number_format(
$price_excl_tax
+
$tax_amount
, 0, ',', '.')?></td>
<?php }else{
<?php }else{
$tax_amount
= (
$price_excl_tax
+
$token
)*10/100; // VAT amoun?>
$tax_amount
= (
$price_excl_tax
+
$token
)*10/100; // VAT amoun
t
?>
<td class="
text
-
right
"><?php echo number_format(
$token
, 0, ',', '.')?></td>
<td class="
text
-
right
token
-
price
"><?php echo number_format(
$token
, 0, ',', '.')?></td>
<td class="
text
-
right
"><?php echo number_format(
$price_excl_tax
+
$token
, 0, ',', '.')?></td>
<td class="
text
-
right
price
-
excl
-
tax
"><?php echo number_format(
$price_excl_tax
+
$token
, 0, ',', '.')?></td>
<td class="
text
-
right
"><?php echo number_format(
$tax_amount
, 0, ',', '.')?></td>
<td class="
text
-
right
tax
-
amount
"><?php echo number_format(
$tax_amount
, 0, ',', '.')?></td>
<td class="
text
-
right
"><?php echo number_format(
$price_incl_tax
+
$token
, 0, ',', '.')?></td>
<td class="
text
-
right
price
-
total2
"><?php echo number_format(
$price_excl_tax
+
$token
+
$tax_amount
, 0, ',', '.')?></td>
<?php }?>
<?php }?>
<td class="
text
-
center
">
<td class="
text
-
center
">
...
...
wp-content/themes/ahoadonviet/woocommerce/checkout/form-checkout.php
View file @
07a8c00b
...
@@ -37,6 +37,8 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
...
@@ -37,6 +37,8 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
<div
class=
"row"
id=
"customer_details"
>
<div
class=
"row"
id=
"customer_details"
>
<div
class=
"col-8"
>
<div
class=
"col-8"
>
<div
class=
"loading"
style=
"display:none;"
><img
src=
"
<?php
echo
get_template_directory_uri
()
?>
/images/rolling-1s-200px.gif"
alt=
""
></div>
<div
class=
"notify-mst txt-red"
style=
"display:none;"
></div>
<?php
do_action
(
'woocommerce_checkout_billing'
);
?>
<?php
do_action
(
'woocommerce_checkout_billing'
);
?>
<?php
do_action
(
'woocommerce_checkout_shipping'
);
?>
<?php
do_action
(
'woocommerce_checkout_shipping'
);
?>
</div>
</div>
...
@@ -61,3 +63,60 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
...
@@ -61,3 +63,60 @@ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_requir
</form>
</form>
<?php
do_action
(
'woocommerce_after_checkout_form'
,
$checkout
);
?>
<?php
do_action
(
'woocommerce_after_checkout_form'
,
$checkout
);
?>
<script >
jQuery
(
document
).
ready
(
function
(
$
)
{
var
loading
=
$
(
'.loading'
);
var
noti
=
$
(
'.notify-mst'
);
$
(
'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
();
}
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
();
}
});
});
});
</script>
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