• Resolved eefkedigibitch

    (@eefkedigibitch)


    Hi there,

    I’m wondering if it is possible to have an out-of-stock notification on the products-overview/shop page.
    This could be in the product-meta or on the image-wrap, that doesn’t matter to me.

    Hope someone can help me!
    Thanks in advance.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support abwaita a11n

    (@abwaita)

    Hi @eefkedigibitch,

    Adding the following code snippet to your functions.php seems to get that done:

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

    *Snippet from this article, though the posted code on that site has a small improvement to be made.
    * It’s advisable to add the code to a child theme

    I hope this helps.

    Thread Starter eefkedigibitch

    (@eefkedigibitch)

    Thanks Abwaita,
    Should this also work if we disabled ‘managing stock’?
    The stock is managed through an api…

    Thread Starter eefkedigibitch

    (@eefkedigibitch)

    Never mind…the customer doesn’t need this function all the sudden.
    Even though, thanks Abwaita

    Plugin Support abwaita a11n

    (@abwaita)

    Thanks for the update @eefkedigibitch.

    Well, in this case, I’ll mark this thread as resolved now. If you’ll have any further questions, feel free to create a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show Sold Out on shop page’ is closed to new replies.