Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add WooCommerce Order Numbers to Orders in SearchWP
<?php
// Add WooCommerce Order Numbers to WooCommerce Orders.
// @link https://searchwp.com/documentation/knowledge-base/search-woocommerce-orders/
add_filter( 'searchwp\entry\data', function( $data, \SearchWP\Entry $entry ) {
$my_extra_meta_key = 'searchwp_order_number';
$my_extra_meta = $entry->get_id() . ' order-' . $entry->get_id() . ' o-' . $entry->get_id();
$data['meta'][ $my_extra_meta_key ] = $my_extra_meta;
return $data;
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.