Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1223336

    Hi guys,
    not sure if this is strictly an Enfold or WooCommerce ‘thing’ – however, by default out of stock items feature the wording ‘Out of Stock’ but in stock items have no wording.

    Is there a way to add ‘In Stock’ wording to in stock items?

    #1223537

    Hey joefraser,

    Please refer to the following:

    Add this to functions.php:

    add_filter( 'woocommerce_get_availability', 'custom_get_availability', 1, 2);
      
    function custom_get_availability( $availability, $_product ) {
        //change text "In Stock' to 'SPECIAL ORDER'
        if ( $_product->is_in_stock() ) $availability['availability'] = __('AVAILABLE', 'woocommerce');
      
        //change text "Out of Stock' to 'SOLD OUT'
        if ( !$_product->is_in_stock() ) $availability['availability'] = __('SOLD OUT', 'woocommerce');
            return $availability;
        }

    Best regards,
    Jordan Shannon

    #1224021

    Thank you

    #1224179

    Hi,

    No problem. Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1224246

    Sorry, yes – Jordan, thank you very much.

    Another one ticked off the list.

    #1224300

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add 'In Stock' Wording’ is closed to new replies.