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
88a54bfe
Commit
88a54bfe
authored
Feb 21, 2020
by
Pham Huy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update checkout form
parent
b40ec477
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
functions.php
wp-content/themes/ahoadonviet/functions.php
+21
-13
price-tpl.php
wp-content/themes/ahoadonviet/template-parts/price-tpl.php
+1
-1
No files found.
wp-content/themes/ahoadonviet/functions.php
View file @
88a54bfe
...
@@ -1030,8 +1030,12 @@ function custom_override_checkout_fields( $fields ) {
...
@@ -1030,8 +1030,12 @@ function custom_override_checkout_fields( $fields ) {
unset
(
$fields
[
'billing'
][
'billing_postcode'
]);
unset
(
$fields
[
'billing'
][
'billing_postcode'
]);
unset
(
$fields
[
'billing'
][
'billing_country'
]);
unset
(
$fields
[
'billing'
][
'billing_country'
]);
unset
(
$fields
[
'billing'
][
'billing_last_name'
]);
unset
(
$fields
[
'billing'
][
'billing_last_name'
]);
unset
(
$fields
[
'billing'
][
'billing_address_1'
]);
unset
(
$fields
[
'billing'
][
'billing_city'
]);
unset
(
$fields
[
'order'
][
'order_comments'
]);
return
$fields
;
return
$fields
;
}
}
add_filter
(
'woocommerce_enable_order_notes_field'
,
'__return_false'
,
9999
);
// 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) {
...
@@ -1121,9 +1125,7 @@ function custom_order_fields($fields) {
...
@@ -1121,9 +1125,7 @@ function custom_order_fields($fields) {
"billing_first_name"
,
"billing_first_name"
,
"billing_email"
,
"billing_email"
,
"billing_phone"
,
"billing_phone"
,
"billing_company"
,
"billing_company"
"billing_address_1"
,
"billing_city"
,
);
);
foreach
(
$order
as
$field
)
foreach
(
$order
as
$field
)
{
{
...
@@ -1133,12 +1135,9 @@ function custom_order_fields($fields) {
...
@@ -1133,12 +1135,9 @@ function custom_order_fields($fields) {
$fields
[
"billing"
]
=
$ordered_fields
;
$fields
[
"billing"
]
=
$ordered_fields
;
$fields
[
'billing'
][
'billing_company'
][
'priority'
]
=
10
;
$fields
[
'billing'
][
'billing_company'
][
'priority'
]
=
10
;
$fields
[
'billing'
][
'billing_address_1'
][
'priority'
]
=
20
;
$fields
[
'billing'
][
'billing_first_name'
][
'priority'
]
=
20
;
$fields
[
'billing'
][
'billing_city'
][
'priority'
]
=
40
;
$fields
[
'billing'
][
'billing_phone'
][
'priority'
]
=
30
;
$fields
[
'billing'
][
'billing_first_name'
][
'priority'
]
=
50
;
$fields
[
'billing'
][
'billing_email'
][
'priority'
]
=
40
;
// $fields['billing']['billing_last_name']['priority'] = 60;
$fields
[
'billing'
][
'billing_phone'
][
'priority'
]
=
60
;
$fields
[
'billing'
][
'billing_email'
][
'priority'
]
=
70
;
return
$fields
;
return
$fields
;
}
}
...
@@ -1147,8 +1146,8 @@ function custom_order_fields($fields) {
...
@@ -1147,8 +1146,8 @@ function custom_order_fields($fields) {
*/
*/
add_filter
(
'woocommerce_checkout_fields'
,
'customize_override_checkout_field'
);
add_filter
(
'woocommerce_checkout_fields'
,
'customize_override_checkout_field'
);
function
customize_override_checkout_field
(
$field
)
{
function
customize_override_checkout_field
(
$field
)
{
$field
[
'billing'
][
'billing_address_1'
][
'required'
]
=
false
;
//
$field['billing']['billing_address_1']['required'] = false;
$field
[
'billing'
][
'billing_city'
][
'required'
]
=
false
;
//
$field['billing']['billing_city']['required'] = false;
$field
[
'billing'
][
'billing_email'
][
'required'
]
=
false
;
$field
[
'billing'
][
'billing_email'
][
'required'
]
=
false
;
$field
[
'billing'
][
'billing_first_name'
][
'label'
]
=
'Người liên hệ'
;
$field
[
'billing'
][
'billing_first_name'
][
'label'
]
=
'Người liên hệ'
;
$field
[
'billing'
][
'billing_first_name'
][
'class'
]
=
array
(
'form-row-wide'
);
$field
[
'billing'
][
'billing_first_name'
][
'class'
]
=
array
(
'form-row-wide'
);
...
@@ -1164,8 +1163,8 @@ function customercode_checkout_field($checkout) {
...
@@ -1164,8 +1163,8 @@ function customercode_checkout_field($checkout) {
'class'
=>
array
(
'class'
=>
array
(
'mst-field form-row-wide'
'mst-field form-row-wide'
)
,
)
,
'label'
=>
__
(
'Mã
khách hàng
'
)
,
'label'
=>
__
(
'Mã
đại lý
'
)
,
'placeholder'
=>
__
(
'Nhập mã
khách hàng
'
)
,
'placeholder'
=>
__
(
'Nhập mã
đại lý
'
)
,
)
,
)
,
$checkout
->
get_value
(
'customercode_checkout_field'
));
$checkout
->
get_value
(
'customercode_checkout_field'
));
echo
'</div>'
;
echo
'</div>'
;
...
@@ -1195,3 +1194,12 @@ function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $o
...
@@ -1195,3 +1194,12 @@ function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $o
);
);
return
$fields
;
return
$fields
;
}
}
// add_filter( 'postbox_classes_post_postexcerpt', function( $classes ) {
// foreach($classes as $key => $class) {
// if( $class == "hidden" ){
// unset($classes[$key]);
// }
// }
// return $classes;
// }, 1000);
wp-content/themes/ahoadonviet/template-parts/price-tpl.php
View file @
88a54bfe
...
@@ -24,7 +24,7 @@ get_header();
...
@@ -24,7 +24,7 @@ get_header();
<tr>
<tr>
<th
scope=
"col"
width=
"60px"
class=
"text-center"
>
STT
</th>
<th
scope=
"col"
width=
"60px"
class=
"text-center"
>
STT
</th>
<th
scope=
"col"
width=
"200px"
class=
"text-center"
>
Gói hóa đơn
</th>
<th
scope=
"col"
width=
"200px"
class=
"text-center"
>
Gói hóa đơn
</th>
<th
scope=
"col"
width=
"1
0
0px"
class=
"text-center"
>
Trị giá
</th>
<th
scope=
"col"
width=
"1
5
0px"
class=
"text-center"
>
Trị giá
</th>
<th
scope=
"col"
width=
"120px"
class=
"text-center"
>
Phí khởi tạo
</th>
<th
scope=
"col"
width=
"120px"
class=
"text-center"
>
Phí khởi tạo
</th>
<th
scope=
"col"
width=
"120px"
class=
"text-center"
>
Thành tiền (VNĐ)
</th>
<th
scope=
"col"
width=
"120px"
class=
"text-center"
>
Thành tiền (VNĐ)
</th>
<th
scope=
"col"
width=
"150px"
class=
"text-center"
></th>
<th
scope=
"col"
width=
"150px"
class=
"text-center"
></th>
...
...
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