Forum Replies Created

Viewing 1 replies (of 1 total)
  • You can create a workaorund by adding your own text instead of the standard messages. just add the following function to your functions.php and replace “YOUR TEXT”. Since I overwrote the strings in the german translation I am not 100% sure if the replace texts are correct written like this. If your text is not replaced with your custom string, check first whether the “original” string is correct.

    Be aware that it will only change the texts on the product page, but not on the cart page.

    function customCartTexts($availability) {

    foreach($availability as $i) {
    $availability = str_replace(‘in stock (can be backordered)’, ‘YOUR TEXT’, $availability);

    $availability = str_replace(‘available on backorder’, ‘YOUR TEXT’, $availability);

    $availability = str_replace(‘out of stock’, ‘YOUR TEXT’, $availability);
    }

    return $availability;
    }

    add_filter(‘woocommerce_get_availability’, ‘customCartTexts’);

Viewing 1 replies (of 1 total)