Adding a Search Bar on Woocommerce My Account Order Page for Customers to Search their Order History

  php, search, searchbar, woocommerce, wordpress

I’m trying to add a search bar to the Woocommerce Storefront My Account "Orders" page. This search bar would appear to the top left of the customer’s orders table, and would search only the orders that they have placed under that account.

I am trying to make the search bar to be able to search by both:

  1. The product(s) order number
  2. Words contained in the title of the product ordered.

Here is what the final result should look like, before some CSS: Customer Order Search

I have seen plugins that allow the admin to search orders from their WP Admin page like this one: WC Order Search Admin but nothing for Customers to search their own order history. I am unsure if this would be compatible with the built-in WordPress search bar, would need a plugin for a search bar to be added to the page by shortcode, or if a search bar needs to be custom coded.

Any guidance would be greatly appreciated. Thanks!

Source: Ask PHP

LEAVE A COMMENT