Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Advanced Order Numbers for WooCommerce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
WooCommerce
Advanced Order Numbers for WooCommerce
Commits
621448ee
Commit
621448ee
authored
Apr 14, 2015
by
Reinhold Kainhofer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the order number post meta to the list of searchable fields
parent
998eaf31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
woocommerce-advanced-ordernumbers.php
woocommerce-advanced-ordernumbers.php
+12
-1
No files found.
woocommerce-advanced-ordernumbers.php
View file @
621448ee
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment