Forums Forums Search & Filter Pro Show only items with value=””

Viewing 2 posts - 11 through 12 (of 12 total)
  • Anonymous
    #239336

    Thank you for your suggestions. Changing the NULL value to a word worked perfectly. I wrote this and it seems to be working just like I needed it to.

    //Add flatrate to database
    add_action( 'woocommerce_update_product', 'hm_sync_on_product_save', 10, 1 );
    function hm_sync_on_product_save( $product_id ) {
         $product = wc_get_product( $product_id );
         $person_multiplier = get_post_meta( $product_id, '_wc_booking_person_cost_multiplier', true);
    		if( empty( $person_multiplier )){
    			update_post_meta($product_id, '_wc_booking_person_cost_multiplier', 'false');
    		}
    	 
    }	
    Trevor
    #239341

    Thanks for getting back to me and sharing your code. I will close this thread for now.

Viewing 2 posts - 11 through 12 (of 12 total)