Commit 621448ee authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Add the order number post meta to the list of searchable fields

parent 998eaf31
......@@ -110,7 +110,9 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
add_option ('ordernumber_step', '1');
// register actions
add_filter( 'woocommerce_get_sections_checkout', array($this, 'add_admin_section'),1);
add_filter( 'woocommerce_get_sections_checkout', array($this, 'add_admin_section'));
// Add the ordernumber post meta to the search in the backend
add_filter( 'woocommerce_shop_order_search_fields', array($this, 'order_search_fields'));
// The checkout page assumes all subpages are payment gateways, so we have to override this:
add_action( 'woocommerce_settings_checkout', array( $this, 'output' ) );
add_action( 'woocommerce_settings_save_checkout', array( $this, 'save' ) );
......@@ -146,6 +148,15 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
WC_Admin_Settings::save_fields( $settings );
* Hook to add the order numer post meta field to the searchable field
* (so the admin can search for the order number in the backend)
public function order_search_fields($fields) {
$fields[] = $this->ordernumber_meta;
return $fields;
* Counter handling (simple loading/storing counters), storing them as options
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment