Hi guys,
I have searched and found solutions to my question, however I’m not getting it to work. So I’m assuming my issue relates to the fact I’m using Woo Tickets.
This is the page where I’d like to replace the “Out of Stock” text with “Class is full”:
OFA Level 1 (Langley)
And I found this function for what I want:
add_filter( ‘woocommerce_get_availability’, ‘custom_get_availability’, 1, 2);
// Our hooked in function $availablity is passed via the filter!
function custom_get_availability( $availability, $_product ) {
if ( !$_product->is_in_stock() ) $availability[‘availability’] = __(‘Class is full’, ‘woocommerce’);
return $availability;
}
From here:https://wordpress.org/support/topic/woocommerce-remove-related-products-and-change-out-of-stock-text
But it’s not working – what’s wrong with the code above?
Thank you!
Cintia