Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Different "Sold Out" message for different products

Home / Forums / Virtue Theme / Different "Sold Out" message for different products

This topic is: Not Resolved
[Not Resolved]
Posted in: Virtue Theme
December 29, 2015 at 8:12 pm

Hello,
I need to indicate when out of stock products are coming back into stock, on the product listing photo in the category.
Would the following code in functions.php work with the current virtue version?
If it will could you help me as far as changing it to handle the 6 different messages I have?

Thank you for any help you can give, John
———————
add_filter(‘woocommerce_get_availability’, ‘availability_filter_func’);
function availability_filter_func($availability)
{
if(is_single( array(2230,2232,2234,2236)))$availability[‘availability’] = str_ireplace(‘Out of stock’, ‘your text here’, $availability[‘availability’]);
return $availability;
}

  • The forum ‘Virtue Theme’ is closed to new topics and replies.