• Resolved Naiara Mooy

    (@naiararomm)


    Hello,

    I am using the ‘uncode’ theme (themforest) and contacting the support of the theme, I am told that this problem must contact the woocommerce support.

    My problem is that when I have one or more products sold out in my store, the default label of the theme ‘out of stock’ does not appear.

    The only thing that appears to me is that in the button of the product table ‘add to the cart’ is replaced by ‘read more’ when it’s out of stock.

    https://www.screencast.com/t/h2VRSrncu

    How can I make the label out of stock?

    For example, In the screenshoots that I attached, the wine ‘Corazón Loco Rosado’ is now out stock but in the button appears ‘read more’.

    https://www.screencast.com/t/Bdr4RynUJN

    Thank u.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi@naiararomm, you may add below code into functions.php inside theme folder:

    
    add_filter( 'woocommerce_get_availability', 'wc_custom_get_availability', 1, 2);
    function wc_custom_get_availability( $availability, $_product ) {
       // Change Out of Stock Text
       if ( ! $_product->is_in_stock() ) {
           $availability['availability'] = __(' Sold Out ', 'woocommerce');
       }
      return $availability;
    }
    Thread Starter Naiara Mooy

    (@naiararomm)

    Hello,

    Thank you for your answer.

    I need to change some of the code, because this code doesn’t work that you ve passed me.

    Thank u.

    @naiararomm, mostly you need to check on your theme template files then.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘TAG ‘OUT STOCK’ IN PRODUCTS’ is closed to new replies.