Woo Checkout Editor - billing fields display problems

I’ve added a billing field with the label of “Position” (billing_position). I’ve noticed an interesting / unwanted behavior with this in the Account area. It’s appending this “Position” field to the billing address details. I’d prefer it wasn’t automatically added there. (see screenshot)

It is also appending it as “position” instead of what is entered there (e.g. President, Superintendent, etc). I did find the solution to this in another thread but thought I might mention it again as a reminder to hopefully fix this with a future release.

This is currently happening on a staging site at charterss.wpengine.com. You can see this with the following user login (secure note below). Click on “My Account” in the top right corner to log in.

As always, thanks for your help!

Hi there,

Thanks for posting in.

I just checked the status of this and the fix for this issue should be included in the next update. The same fix in your provided URL.

Thanks!

For clarification, are you saying that both of these issues will be fixed in the next update, or only the one I linked to in the other thread?

Hi there,

I’m not sure, but it should be. Our developer is probably on it as I see some code changes.

Thanks!

Hi, @Jmot!

Thanks for your question. This issue (content of a custom field not being displayed) will be addressed on next release of the extension for sure. Great to hear you already find a temporary solution on our support forum.

About the position where the custom field is positioned, at the moment we don’t have a way to control that. Woo Checkout Editor allows to edit Billing, Shipping and Extra fields, saving the schema on the database so WooCommerce does the actual saving/retrieving. The display part is done by WooCommerce directly and the extension just informs what extra fields are available.

Thanks!

Hi Rafael, the problem isn’t where it is positioned within the billing details, the problem is that it’s positioned there at all. It shouldn’t automatically be added, in my opinion. The billing email and the billing phone aren’t automatically added to the billing address, and I don’t think the “billing_position” should be automatically added either.

Is there any way to work around this?

Hi, @Jmot,

Unfortunately, we don’t have this as a setting on Woo Checkout Editor (and not planning to do it so far). Email/Phone are handled individually by WooCommerce to be displayed under “Customer details”, and “Billing/Shipping details” filter this data from a common array.

But WooCommerce implements some hooks that can be useful to make some tweaks.

For example, you can remove a custom field from being displayed in Order details (both on post-checkout page and order details) adding to your theme functions.php file:

function custom_woo_get_order_address($address_array, $order) {
  // var_dump($address_array); // <== you can dump and check fields available at this point
  // var_dump($order); // <== the order class, you can get many info here to inject / create your own rules
  unset($address_array['cpf']); // <== removing a custom field here (Brazilian "cpf" in the example)
  return $address_array; // <== returning the modified array
}
add_filter( 'woocommerce_order_formatted_billing_address', 'custom_woo_get_order_address', 10, 2 );

// or for shipping

add_filter( 'woocommerce_order_formatted_shipping_address', 'custom_woo_get_order_address', 10, 2 );

You can search on WooCommerce docs/code for more hooks available.

It’s out of the scope of our support to handle all needs of customization that can be made for specific situations (like yours here). Nevertheless, we’ll consider an option to show/hide a field in Order details as a possible feature in future versions of Woo Checkout Editor.

Hope it helps!

Thanks Rafael, that’s helpful.

You’re most welcome!