Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @payal1995,

    Displaying the out of stock message on your site will require a bit of customization, either in your site’s theme or otherwise.

    I recommend taking a look at these two articles for reference:

    * WooCommerce: Show “Sold Out” on Archive/Product Page
    * Display “ Out of Stock ” on catalog view Woocommerce

    Hopefully that will get you moving in the right direction with this ??

    Thread Starter payal.sinha

    (@payal1995)

    I have tried both of these codes . None of them worked. I have written them on child theme function.php. Can you tell me where to write these codes? It’s not working from function.php file.

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    I just tested the first of those snippets, and it appears to be working:

    out of stock
    Link to image: https://d.pr/i/lZNuAB

    If it is not working on your site in your child theme’s functions.php file, you could try adding it with the Code Snippets plugin instead:
    https://www.ads-software.com/plugins/code-snippets/

    However, if the snippet doesn’t work there either, then it’s possible it may not be compatible with your site’s theme. Please try temporarily switching back to the default Storefront theme to see if that makes a difference.

    Thread Starter payal.sinha

    (@payal1995)

    Hi

    I’am not able to get sold out message by using plugin also.

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    I’am not able to get sold out message by using plugin also.

    In that case, it’s possible something in your theme (template overrides, other code, etc) or in another active plugin on your site might be conflicting with the snippet and preventing it from working.

    Testing the second snippet also worked without issue on my test site with just WooCommerce and the default Storefront theme. While the first snippet displayed as shown in the screenshot in my previous reply, the second one displayed like this:

    out of stock
    Link to image: https://d.pr/i/LX50TA

    To narrow down what is causing it to not work on your site, please temporarily switch your theme back to the default Storefront theme and disable all plugins except for WooCommerce, then check to see if it works. If it does, then switch your theme back and reactivate plugins one-by-one until you find the one that is causing the issue.

    You can read about testing for conflicts in our documentation here:
    https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this thread as resolved. If you have any further questions, please start a new thread.

    Have a wonderful day!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Out of stock’ is closed to new replies.