Commit 88a54bfe by Pham Huy

update checkout form

parent b40ec477
...@@ -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) {
...@@ -1117,13 +1121,11 @@ add_action( 'rest_api_init', function () { ...@@ -1117,13 +1121,11 @@ add_action( 'rest_api_init', function () {
add_filter("woocommerce_checkout_fields", "custom_order_fields"); add_filter("woocommerce_checkout_fields", "custom_order_fields");
function custom_order_fields($fields) { function custom_order_fields($fields) {
$order = array( $order = array(
"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);
...@@ -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="100px" class="text-center">Trị giá</th> <th scope="col" width="150px" 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>
......
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