Home Forums WoodMart support forum Change stock text without loseing styling

Change stock text without loseing styling

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #402348

    JamesUK
    Participant

    Hi,

    can i change the In Stock / Out of Stock text?

    I have tried this but it breaks the styling and only changes it on single product page
    ——————————————
    add_filter( ‘woocommerce_get_availability’, ‘custom_get_availability’, 1, 2);

    function custom_get_availability( $availability, $_product ) {
    //change text “In Stock’ to ‘custom’
    if ( $_product->is_in_stock() ) $availability[‘availability’] = __(‘<p style=”color:green”>IN STOCK ONLINE</p>’, ‘woocommerce’);

    //change text “Out of Stock’ to ‘custom’
    if ( !$_product->is_in_stock() ) $availability[‘availability’] = __(‘SOLD OUT – contact to check showroom stock’, ‘woocommerce’);
    return $availability;
    }
    —————————————-

    #402352

    Luke Nielsen
    Keymaster

    Hello,

    You can change this text by using the Loco Translate plugin, here is our documentation on how to use it:

    https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/

    Please let us know if there is anything further we can assist you with!

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)