change text problem woocommerce_get_availability_text
-
Hi, I need different text availability for one product category, I truyng:
/* backorder text on single product page */ function so_42345940_backorder_message( $text, $product ){ if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { $text = __(' This product can be ordered, the delivery time is 12-22 days. ', 'your-textdomain' ); $idcat = wc_get_product_term_ids( wc_get_product()->get_id(), 'product_cat' ); if(($idcat!="") && ($idcat[0] == 95)) { $text = __(' This product can be ordered, the delivery time is 1-5 working days. ', 'your-textdomain' ); } } return $text; } add_filter( 'woocommerce_get_availability_text', 'so_42345940_backorder_message', 10, 2 );When I test – all work, but after few days I see that my snippet are disabled because error – https://i.imgur.com/Utf9GWK.png
There are probably some conditions occurring that cause the error… What could it be? I think I need to make additional conditions before executing the code.thanks
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘change text problem woocommerce_get_availability_text’ is closed to new replies.