Out of stock under price - by tlou2 - on WordPress WooCommerce support

This topic has 6 replies, 2 voices, and was last updated 4 years, 8 months ago ago by Olga Barlow

  • Avatar: tlou2
    tlou2
    Participant
    April 15, 2021 at 08:17

    Hello
    i have place this under child theme but still no changes ..my question was
    how do i place the out of stock to be after price in text not an image https://ibb.co/ZWhMYBz

    Add the below code to functions.php of your child theme

    // display an 'Out of Stock' label below the price
    add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_stock', 10 );
    function woocommerce_template_loop_stock() {
        global $product;
        if ( ! $product->is_in_stock() )
            echo '<p class="stock out-of-stock">Out of Stock</p>';
    }

    And the code below to child theme style.css

    .content-product .stock.out-of-stock {
        position: relative;
        transform: none;
        text-align: center;
        left: auto;
        top: auto;
    }
    .content-product .product-image-wrapper .stock.out-of-stock {
        display: none;
    }
    5 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Participant
    April 15, 2021 at 10:15

    Hello,

    Provide us with WP Dashboard and FTP access to your site to check and help you.

    Regards

    Avatar: tlou2
    tlou2
    Participant
    April 15, 2021 at 11:18

    Please make it also display in-stockr with quantity and on backorder on shoppage under price.

    Please contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Participant
    April 15, 2021 at 12:27

    Hello,

    Check now.

    Regards

    Avatar: tlou2
    tlou2
    Participant
    April 15, 2021 at 12:44

    thanks exactly what i wanted..what about the in stock(with quantity) to display also on backorder to display

    Thank you

    Avatar: Olga Barlow
    Olga Barlow
    Participant
    April 15, 2021 at 12:51

    Hello,

    You are welcome.
    We don’t have option to display number of items in stock there. You can implement this with additional customization. Submit customization request here because additional customization is not included in our basic support https://themeforest.net/page/item_support_policy

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

The issue related to '‘Out of stock under price’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.