Replies: 0
Hi, we have tried to change the “out of stock” text on specific products with the following code, but it does not work..
add_filter( ‘woocommerce_get_availability’, ‘wcs_custom_get_availability’, 10, 2);
function wcs_custom_get_availability( $availability, $_product ) {
// Out of stock
if ( ! $_product->is_in_stock() && $_product->get_id() == ‘18496’ && ‘17392’ ) {
$availability[‘availability’] = __(‘Dette hold er desværre udsolgt’, ‘woocommerce’);
}
return $availability;
}
What are we doing wrong?