Pricing Process Reviews Contact

Divi Guy blog

How to add search fields to WooCommerce orders page

You may find it useful to have additional search fields in the WooCommerce orders page in the WP admin area. Add the function below to your child theme functions.php file.

/* add search fields to woocommerce orders page Allowed search fields: _order_key _billing_first_name _billing_last_name _billing_company _billing_address_1 _billing_city _billing_postcode _billing_country _billing_state _billing_email _billing_phone _order_items */ add_filter( ‘woocommerce_shop_order_search_fields’, ‘woocommerce_shop_order_search_order_total’ ); function woocommerce_shop_order_search_order_total( $search_fields ) { $search_fields[] = ‘_billing_first_name’; $search_fields[] = ‘_billing_last_name’; $search_fields[] = ‘_billing_company’; $search_fields[] = ‘_billing_address_1’; $search_fields[] = ‘_billing_city’; $search_fields[] = ‘_billing_postcode’; $search_fields[] = ‘_billing_state’; $search_fields[] = ‘_billing_email’; $search_fields[] = ‘_billing_phone’; return $search_fields; } 

Need a hand?

Need help with your Divi website?

Book a Divi consultation and we can fix it together over Zoom, or ask for an estimate for bigger jobs.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Search

Browse

More tips

Got a question?

Ask me anything

Stuck on something in Divi or WordPress? Ask away and I will reply by email, usually within 24 hours.

Ask a Question

Tell me about your project. The more details the better.

"*" indicates required fields

Make a payment

Got an invoice?

Pay an invoice, a deposit or a tip in about a minute. Card or PayPal, secure checkout, and I never see your card number.

Make a payment