Skip Navigation

[Resolved] Woocommerce billing company field

This thread is resolved. Here is a description of the problem and solution.

Problem:

Display customer information in the WooCommerce order post view.

Solution:

You can try these:

customer ID: [wpv-post-field name="_customer_user"]

customer billing_company: [wpv-user field='billing_company' id='[wpv-post-field name="_customer_user"]']

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-user

This support ticket is created 3 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 11 replies, has 2 voices.

Last updated by martham 3 years ago.

Assisted by: Luo Yang.

Author
Posts
#2253933

I am trying to make the Woocommerce billing company field usable within Toolset. I am looking in Settings | Front-End Content | Hidden Custom Fields.

When I click the button to Select Custom Fields, there is no option for _billing_company

I have been able to add most other Woocommerce billing fields. But there is also no option for _billing_address_2 either.

Please advise on if we can get these available for use and how to do it.

#2254623
billing_company.jpg

Hello,

I assume we are talking about Woocommerce Billing Company field, it is a custom user field, the field slug is "billing_company", you can use it directly in user Views GUI, see my screenshot: billing_company.jpg

#2254635

I'm not seeing anything that says User field. Is there some setting I have to enable for these fields to become available? I believe I'm looking at the same thing as what's in your screenshot. I enabled Query Filter in Screen Options on one of our View edit pages. But when I clicked to see the available fields in there, I didn't see anything saying User field. All the Woocommerce billing fields show under Custom field, but billing company is not present among them. It is not present under Toolset | Settings | Front-end content | Hidden Custom Fields either.

#2254639

As I mentioned above, it is not a hidden field, and you can use it in the user view directly, if you need more assistance for it, please provide a test site, I can setup a demo for you

#2254663

As I mentioned above, it is a custom user field, you can use it in user view, but you provide a post view, so you won't see it in the GUI.

Are you going to display the customer's "billing_company" in the post view? please confirm it.

#2254665

I have add below lines in the post view:
customer ID: [wpv-post-field name="_customer_user"]
customer billing_company: [wpv-user field='billing_company' id='[wpv-post-field name="_customer_user"]']

Please test again, check if it is what you want

More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-user

#2254667

OHHHHHHHH OK, I get it now. Forgive my lack of familiarity with everything. I understand what you're saying now that I'm not seeing it because this is an Order view and not a User view. But that's weird because all the other Billing related fields with the order are available in here. Why is billing company not among them?

Yes, we want to have Billing Company present as a field on the following two Views:

Manage Members
hidden link

and

Orders Export
hidden link

Is there any way you can make Billing Company available for use anywhere like the other billing fields? If you could make billing_address_2 available as well, that would be ideal.

#2254675

Please check my last answer:
https://toolset.com/forums/topic/woocommerce-billing-company-field/#post-2254665

I have put those codes in below post view:
hidden link

You can test the result here:
hidden link

#2254679

That's looking good. I've restructured the output of the view to make it more readable instead of displaying all on one line.

I've also added it to the second view successfully.

Where did you enter "test billing Company" to provide that data for the field? I'm not seeing it among our three test orders in Woocommerce so I just wanted to know where that data is coming from.

#2254685

I put it here for test purpose:
hidden link
field "Company"

You can remove it.

#2254703

OK, that's fine. I just wanted to see where it was being defined. All good. Thanks again. This one is resolved now. Knocking them all down!!!

#2254705

My issue is resolved now. Thank you!