Looking for help?
< All Topics
Print

Hide Variation from Search result on POS. Show variable only

function custom_op_product_data_hide_variation_search($product_data,$product){
    $_product = wc_get_product($product_data['id']);
    if($_product)
    {

        if($_product->get_type() == 'variation')
        {
            $product_data['display_search'] = 'no';

        }
       
    }
    
    return $product_data;
}
add_filter('op_product_data','custom_op_product_data_hide_variation_search',10,2);
Table of Contents