Support » Plugin: WooCommerce » ‘Out of stock’ not available with no product price

  • Resolved petebm

    (@petebm)


    Hi

    I don’t think this has been asked previously – we have a number of products that have never in fact been in stock since our website was set up, and so don’t have a realistic price. I would like to be able to mark them as out of stock, but remove the misleading price (often £0) completely, but this doesn’t seem possible. As soon as I remove the price, the out of stock notice goes.

    Is it possible to do this?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support stephjacq

    (@stephjacq)

    Automattic Happiness Engineer

    Hi @petebm you can manage stock with the options here under WooCommerce > Settings > Product > Inventory: https://docs.woocommerce.com/document/configuring-woocommerce-settings/#inventory-options

    This works independently of the pricing so should fix your issue.

    petebm

    (@petebm)

    Hi @stephjacq – thanks very much for your speedy reply. I’ve now tried changing those settings, and I still don’t get the out of stock notification, I’m afraid.

    I’ve set the option for ‘Enable stock management’ in Woocommerce settings, and left ‘Out of stock threshold’ at 0. I tried leaving ‘Stock display format’ at ‘Always’, and changing it to ‘Never’.

    On the product screen, I enabled ‘stock management at product level’, and set the level at 0; I then went back to just going for the ‘Out of stock’ option, without enabling ‘stock management at product level’.

    I’m afraid I couldn’t find any combination of settings that allowed the ‘Out of stock’ notification while leaving the Price field blank.

    Sorry!

    Plugin Support stephjacq

    (@stephjacq)

    Automattic Happiness Engineer

    Hi @petebm thanks for the clarification.

    This can be achieved with some customization, by adding a variation of this code which shows Call for price when the price field is blank: https://gist.github.com/mikejolley/1597957

    petebm

    (@petebm)

    Hi @stephjacq – my heart sank when I saw ‘This can be achieved with some customization’, as my skill set is decidedly limited. However, I added the code to my child theme’s functions.php, changed it to say ‘No price at present’ – and it worked like a charm. Brilliant.

    My thanks to you and @mikejolley.

    Plugin Support stephjacq

    (@stephjacq)

    Automattic Happiness Engineer

    Hooray! Glad to hear it @petebm. Enjoy your weekend 🙂

    petebm

    (@petebm)

    Aaargh!

    I spoke too soon! I was so pleased that tinkering with that customisation had worked that I failed to look a little further down the screen to notice that the ‘Out of stock’ message still wasn’t showing. Logical, really – that bit of code is presumably just to enable the price field to be empty, and won’t have any effect on the notification.

    So – I’ve now amended that ‘Call for price’ to say ‘Sorry – out of stock at present’, which is pretty much what I was wanting to achieve (ie no price, plus out of stock message). I realise this doesn’t solve the problem, but as a workaround it’ll do me fine; if you want to look further into it, please feel free – but you’ve probably got better things to do!

    Cheers
    Pete

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.