Code samples

Search products by id or sku
add_filter( "wpo_custom_product_search", function($ids,$query_args,$term){ // check if it's product id $product = wc_get_product($term); if( ...
Wed, 15 Apr, 2020 at 2:25 PM
Search products by custom field "_barcode"
add_filter( "posts_where", function($where, $query){ global $wpdb; if ( isset( $query->query_vars['OR_sku_filter'] ) ) { $like...
Mon, 7 Oct, 2019 at 10:04 AM
Customize autocomplete results ( + user meta field SavingsID )
if( isset( $_GET['wpo_find_customer'] ) ) { add_filter( "woocommerce_json_search_found_customers", function($customers){ foreach($c...
Mon, 7 Oct, 2019 at 10:02 AM
Show variations in same order as they displayed inside the product
//show variations in same order as they displayed inside the product add_filter( 'wpo_search_products_and_variations_results', function ( $result,...
Tue, 8 Oct, 2019 at 8:56 AM
Use external address lookup APIs(getaddress.io)
You must define javascript function wpo_get_address_autocomplete_init Sample  code  , you must replace YOUR_API_KEY with your key add_filter('...
Mon, 20 Jan, 2020 at 7:58 PM
Show extra information in section "Totals"
You should use hook wpo_cart_updated_additional_data. For example, you installed "WooCommerce Account Funds"  and want to  show amount funded ...
Thu, 2 Jan, 2020 at 9:15 AM
Override shipping/billing city with custom city list
1. Visit >Settings>Custom fields and add to section "Customer fields" following text ( edit list for your needs) City|city|select|CityN...
Fri, 1 Nov, 2019 at 2:16 PM
Show customer phone
add_filter( "wpo_get_customer_by_array_data", "wpo_show_customer_phone_number", 5 ); add_filter( "wpo_after_update_customer",...
Mon, 7 Oct, 2019 at 9:56 AM
Hide created product in Yoast feed
//don't show product in Yoast feed! add_action('wpo_create_custom_product', function($post_id, $product){ update_post_meta($post_id, "_y...
Mon, 7 Oct, 2019 at 9:55 AM
SagePay: do not perform 3D-Secure checks and always authorise
add_action( 'woocommerce_before_pay_action', function( $order ){ $user_id = get_post_meta( $order->get_id() , '_wpo_order_creator', tr...
Mon, 7 Oct, 2019 at 9:58 AM