Support Forums

Support Forums Forums Search & Filter Pro "In Stock" Filter

This topic is: not resolved

This topic contains 75 replies, has 4 voices, and was last updated by  Ben Chentnik 5 hours, 52 minutes ago.

Viewing 10 posts - 1 through 10 (of 76 total)
  • Ben Chentnik
    #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 Moderator
    #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.

    Jordan
    #213661

    Ben, are you using WooCommerce?

    Ben Chentnik
    #213690

    Thanks for the quick response guys!

    Trevor – how could I go about setting that up?

    Jordan – yes I am.

    Trevor Moderator
    #213699

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

    Jordan
    #213708

    Yep.

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

    Jordan
    #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.

    Jordan
    #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.

    Ben Chentnik
    #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 Moderator
    #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 76 total)

You must be logged in to reply to this topic.