• Resolved ibertrix

    (@ibertrix)


    Hi,

    I′m using wp-cli for list customers from woocommerce but I want to list only certain data from the billing array, only province and first name for instance. I can get the list field billing but not its elements:

    wp wc customer list –field=billing –user=admin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mouli a11n

    (@mouli)

    @ibertrix
    I am not a developer so might not be the best person to ask about this but my thoughts are as follows:
    * Try retrieving individual fields such as:

    wp wc customer list –field=billing_first_name –user=admin

    and

    wp wc customer list –field=billing_state –user=admin

    or multiple fields at once:

    wp wc customer list –fields=billing_state,billing_first_name  –user=admin

    Can you share with us what the current response looks like please?

    If you are comfortable with coding yourself and have questions, I would also recommend that you consider:

    There is also the WC CLI manual here:
    https://github.com/woocommerce/woocommerce/wiki/WC-CLI-Overview#command-1

    I hope that helps you to figure it out.

    Thread Starter ibertrix

    (@ibertrix)

    Thanks for answering! In all of them I get the same response:

    Error: Invalid field: billing_first_name.

    Hi @ibertrix

    You are most welcome and thanks for trying the solutions above.

    In addition to what @mouli mentioned above, this is a fairly complex development topic that would require customization to do it. Since custom coding is outside our scope of support, I am leaving this thread open for a bit to see if anyone can chime in to help you out.

    For questions related to development and custom coding, your best bet is to ask on any of these channels for support. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, too.

    Hope this helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to list specific field within an array in wp-cli wc user’ is closed to new replies.