In other words, it seems there was some odd mapping problem where the mapping of the first and last name fields was showing as a required “email” field
The problem resolves when disabling the plugin so that no mapping is happening, or if using another similar plugin to accomplish the custom checkout fields
WC version 8.6.1
WP version 6.4.2
thanks in advance
]]>The field is removed, but I noticed an error. When I add a product and go to the cart page to simulate shipping, the address is shown correctly, but when I go to the checkout page and return to the cart page, the undefined value is added to the address. This only happens because of the removal of address 2.
I’ve already tried using the woocommerce_default_address_fields, woocommerce_billing_fields, woocommerce_shipping_fields and woocommerce_checkout_fields filters. I’ve also disabled plugins that may be related to WooCommerce.
This is the most recent code from my attempts:
add_filter( 'woocommerce_billing_fields' , 'custom_billing_fields' );
function custom_billing_fields( $fields ) {
unset($fields ['billing_company']);
$fields['billing_neighborhood']['label'] = 'Bairro';
$fields['billing_number']['class'] = array( 'form-row-first', 'address-field' );
$fields['billing_phone']['class'] = array( 'form-row-first', 'address-field' );
$fields['billing_cpf']['class'] = array( 'form-row-last', 'person-type-field', 'validate-required' );
$fields['billing_neighborhood']['class'] = array( 'form-row-first', 'address-field' );
$fields['billing_email']['priority'] = 21;
$fields['billing_phone']['priority'] = 22;
$fields['billing_number']['priority'] = 60;
$fields['billing_neighborhood']['priority'] = 75;
$fields['billing_neighborhood']['required'] = true;
return $fields;
}
add_filter( 'woocommerce_shipping_fields' , 'custom_shipping_fields' );
function custom_shipping_fields( $fields ) {
unset($fields ['shipping_company']);
$fields['shipping_neighborhood']['label'] = 'Bairro';
$fields['shipping_number']['class'] = array( 'form-row-first', 'address-field' );
$fields['shipping_neighborhood']['class'] = array( 'form-row-first', 'address-field' );
$fields['shipping_number']['priority'] = 60;
$fields['shipping_neighborhood']['priority'] = 75;
$fields['shipping_neighborhood']['required'] = true;
return $fields;
}
add_filter( 'woocommerce_default_address_fields', 'custom_default_address_fields' );
function custom_default_address_fields( $fields ) {
unset($fields['address_2']);
if(is_account_page() || is_checkout()) {
$fields['postcode']['class'] = array( 'form-row-first', 'address-field' );
$fields['address_1']['class'] = array( 'form-row-last', 'address-field' );
$fields['city']['class'] = array( 'form-row-last', 'address-field' );
$fields['state']['class'] = array( 'form-row-last', 'address-field' );
}
return $fields;
}
I’ve tried using $unset($fields[‘billing_address_2’]); in the ‘woocommerce_billing_fields’ filter, $unset($fields[‘shipping_address_2’]); in the filter ‘woocommerce_shipping_fields’ and $unset($fields[‘billing’][‘billing_address_2’]); $unset($fields[‘shipping’][‘shipping_address_2’]); in the ‘woocommerce_checkout_fields’ filter.
None of the attempts worked. Every time I recalculate in the cart, the address appears correctly (but I noticed that it only asks/shows the city). When I go to the checkout page and return to the cart, the street address is also added, but with the undefined that comes from address 2.
]]>I need help to show pickup date/time and hide Shipping details when local pickup is selected and vice versa on the checkout page. I am using the plugin “WooCommerce Local Pickup Time Select”
This is my site:
https://www.provectusdigital.com.au/
Any help much appreciated.
]]>The “AUTO FILL WOOCOMMERCE BILLING & SHIPPING FIELDS” is not working.
]]>when adding or editing either an admin order or a customers details, the zipcode is always shown after the city. No matter the customers country, the users language or the site language…
Of course, this is no biggie, it is just that it’s not common in the Netherlands and I would like to change the order.
]]>Is there a way i can replicate this using Woocommerce?
Thank you in advance!
]]>I wanted to use the Woo-commerce blocks checkout for my digital & virtual products. As I am selling virtual goods, I don’t need my customers billing address.
All I need is their First Name, Last Name, and Email Address.
But, in the Woo-commerce blocks checkout, I did not find any option to hide billing address.
I previously used the custom checkout fields plugin in classic WordPress Checkout. But looks like that plugin does not support the WooCommerce Blocks Checkout.
I really like the way the new WooCommerce Blocks checkout looks and want to use it for my virtual goods store.
It would be very helpful if anyone can help me get rid of the billing address in checkout. Maybe by using some custom css?
Looking forward to your response.
Thank You in advance.
]]>