• Resolved Valdinia

    (@valdinia)


    I have many orders.
    Some of them have values in the Billing Company field, other don’t have.
    I have to filter the orders

    I add Filtering options:
    Billing Company is empty
    OR
    Billing Company equals ”

    The result is:
    No matching Orders found for selected filter rules, despite the fact that I actually have orders with no Billing Company data.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hey @valdinia,

    Since the billing company field doesn’t exist at all when it’s empty in orders, you’ll have to use the WP_Query Results option to do this: https://www.wpallimport.com/documentation/export/wp-query-results/.

    Here is an example query that you can modify as needed:

    "post_type"   => "shop_order",
    "post_status" => array( "wc-completed", "wc-pending", "wc-processing" ),
    "meta_query"  => array(
         "relation" => "OR",
         array(
              "key"     => "_billing_company",
              "compare" => "NOT EXISTS"
         ),
         array(
              "key"     => "_billing_company",
              "value"   => "",
              "compare" => "="
         )
    )
    Plugin Author WP All Import

    (@wpallimport)

    Hi @valdinia,

    I’m going to go ahead and mark this as resolved since it’s been a while. You can follow up here if you still have questions about this issue.

    Anyone else, please open a new topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtering options “Billing Company is empty” NOT WORKING’ is closed to new replies.