Skip to content
Advertisement

How to get all checkout fields from WooCommerce?

I like to get all available checkout fields, including third party ones:

JavaScript

returns a fatal error:

JavaScript

Is there an offical way to get them?

Edit:

My plugin needs a dropdown field with all available checkout fields on the backend. What I like to have is an array like this (I var_dump the $checkout_fields variable of the WC_Checkout class) :

JavaScript

Advertisement

Answer

i was facing the same issue . here’s how i managed it .

JavaScript

Now you can get billing and shipping fields respectively in this class.

JavaScript

regards

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement