“In Stock” Filter

Forums › Forums › Search & Filter Pro › “In Stock” Filter

Tagged: 

  • This topic has 106 replies, 4 voices, and was last updated 7 years ago by Ross.
Viewing 10 posts – 1 through 10 (of 107 total)
  • Anonymous
    #213637

    Hey Trevor I hope all is well! I am using S&FP strictly for a shop page and was wondering if there’s any way to add a function/option where customers are able to select “show in stock only” so that all items that are out of stock are filtered out…essentially a digital version of looking through a catalog that only shows products that are available.

    Inventory is tracked for every single product and backorders aren’t allowed so I’d imagine this should be relatively simple but I could be wrong, do you have any insight on this?

    Trevor
    #213657

    There would have to be a custom field that holds logical 0/1, true/false, yes/no type of value to show stock status. Stock level would not work.

    Anonymous
    #213661

    Ben, are you using WooCommerce?

    Anonymous
    #213690

    Thanks for the quick response guys!

    Trevor – how could I go about setting that up?

    Jordan – yes I am.

    Trevor
    #213699

    Doesn’t WooCommerce have a custom field (post meta) called stock status?

    Anonymous
    #213708

    Yep.

    The key you’ll want to filter by is: _stock_status

    Anonymous
    #213710

    Actually ignore my post above, that’s not directly connected with the actual number of stock available.

    However that key is: _stock

    So combine them maybe.

    Anonymous
    #213712

    Again just corrected myself, sorry! haha.

    If a status is IN-STOCK then the check if any items are available still has already been done so yeah, _stock_status is correct to use as the filter meta key.

    Anonymous
    #213720

    Thanks for the quick responses guys!

    Jordan how do you recommend setting it up? I did it as a “choice” and the options were either “instock” or “outofstock”. I’d like to have it where it just says “Show in-stock only” and that’s all.

    Trevor
    #213722

    I might set it up as a checkbox, but set the options to manual and just add the one you want and the label you want.

Viewing 10 posts – 1 through 10 (of 107 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.