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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
functions.php
wp-content/themes/ahoadonviet/functions.php
+22
-14
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 ) {
unset
(
$fields
[
'billing'
][
'billing_postcode'
]);
unset
(
$fields
[
'billing'
][
'billing_country'
]);
unset
(
$fields
[
'billing'
][
'billing_last_name'
]);
unset
(
$fields
[
'billing'
][
'billing_address_1'
]);
unset
(
$fields
[
'billing'
][
'billing_city'
]);
unset
(
$fields
[
'order'
][
'order_comments'
]);
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 );
// function wc_limit_one_per_order( $passed_validation) {
...
...
@@ -1117,13 +1121,11 @@ add_action( 'rest_api_init', function () {
add_filter
(
"woocommerce_checkout_fields"
,
"custom_order_fields"
);
function
custom_order_fields
(
$fields
)
{
$order
=
array
(
$order
=
array
(
"billing_first_name"
,
"billing_email"
,
"billing_phone"
,
"billing_company"
,
"billing_address_1"
,
"billing_city"
,
"billing_company"
);
foreach
(
$order
as
$field
)
{
...
...
@@ -1133,12 +1135,9 @@ function custom_order_fields($fields) {
$fields
[
"billing"
]
=
$ordered_fields
;
$fields
[
'billing'
][
'billing_company'
][
'priority'
]
=
10
;
$fields
[
'billing'
][
'billing_address_1'
][
'priority'
]
=
20
;
$fields
[
'billing'
][
'billing_city'
][
'priority'
]
=
40
;
$fields
[
'billing'
][
'billing_first_name'
][
'priority'
]
=
50
;
// $fields['billing']['billing_last_name']['priority'] = 60;
$fields
[
'billing'
][
'billing_phone'
][
'priority'
]
=
60
;
$fields
[
'billing'
][
'billing_email'
][
'priority'
]
=
70
;
$fields
[
'billing'
][
'billing_first_name'
][
'priority'
]
=
20
;
$fields
[
'billing'
][
'billing_phone'
][
'priority'
]
=
30
;
$fields
[
'billing'
][
'billing_email'
][
'priority'
]
=
40
;
return
$fields
;
}
...
...
@@ -1147,8 +1146,8 @@ function custom_order_fields($fields) {
*/
add_filter
(
'woocommerce_checkout_fields'
,
'customize_override_checkout_field'
);
function
customize_override_checkout_field
(
$field
)
{
$field
[
'billing'
][
'billing_address_1'
][
'required'
]
=
false
;
$field
[
'billing'
][
'billing_city'
][
'required'
]
=
false
;
//
$field['billing']['billing_address_1']['required'] = false;
//
$field['billing']['billing_city']['required'] = false;
$field
[
'billing'
][
'billing_email'
][
'required'
]
=
false
;
$field
[
'billing'
][
'billing_first_name'
][
'label'
]
=
'Người liên hệ'
;
$field
[
'billing'
][
'billing_first_name'
][
'class'
]
=
array
(
'form-row-wide'
);
...
...
@@ -1164,8 +1163,8 @@ function customercode_checkout_field($checkout) {
'class'
=>
array
(
'mst-field form-row-wide'
)
,
'label'
=>
__
(
'Mã
khách hàng
'
)
,
'placeholder'
=>
__
(
'Nhập mã
khách hàng
'
)
,
'label'
=>
__
(
'Mã
đại lý
'
)
,
'placeholder'
=>
__
(
'Nhập mã
đại lý
'
)
,
)
,
$checkout
->
get_value
(
'customercode_checkout_field'
));
echo
'</div>'
;
...
...
@@ -1195,3 +1194,12 @@ function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $o
);
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();
<tr>
<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=
"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"
>
Thành tiền (VNĐ)
</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