Add filter in class-mfn-builder-woo-helper.php

Hi,

Line 182 to 184 in class-mfn-builder-woo-helper.php

if( ! $product->is_in_stock() && $soldout = mfn_opts_get( 'shop-soldout' ) ){

$output .= '<span class="soldout"><h4>'. $soldout .'</h4></span>';

}

change

if( ! $product->is_in_stock() && $soldout = mfn_opts_get( 'shop-soldout' ) ){

$soldouttext = apply_filters( 'soldouttext', $soldout , $product->get_id());

$output .= '<span class="soldout"><h4>'. $soldouttext .'</h4></span>';

}


for example in theme child


function custom_soldout_text($soldout, $product_id) {

 $texto_personalizado = get_post_meta($product_id, 'texto_de_agotado', true);

if (!empty($texto_personalizado)) {

    return $texto_personalizado;

  } else {

    return $soldout;

  }

}

add_filter('soldouttext', 'custom_soldout_text', 10, 2);


This will help make a custom field and display other text

Comments

Sign In or Register to comment.