Published on the American Booksellers Association (https://staging.bookweb.org)

Home > Views > Filtering Views by Stock Status

Filtering Views by Stock Status

Stores can now hide out of stock products and only display items that are in stock. Using a combination of Local Store Inventory and a View, you can create a display of readily available titles for customers to shop from. If the titles are not in stock, they will simply disappear from the view until their inventory numbers are updated with an in stock status.
 
This filter will only appear if your website has Local Store Inventory (LSI) enabled and you are uploading LSI files. Please review our help documentation for more information on Local Store Inventory. [1]
 
For this example, we will be working with a Front Page Booklist that is displayed on the homepage on the website. We will be adding an LSI Stock Filter to the View in order to only display books that are in-stock at the store. 
 
Before we add the stock filter, all 6 books are appearing in the view. We want to only show the books that appear as ‘On Hand’ in our LSI file. 
 
Screenshot of a frontpage booklist with 6 titles
 
Reminder: When working with a View with multiple displays, remember to save your changes to that display only.
 

Adding the LSI Stock Filter to the View

  1. Navigate to Structure > Views
  2. Locate the View (Example: Front Page Booklist)
  3. Click ‘edit’
  4. Under Fields click the item Content: Books
  5. Under Formatter click the checkbox labeled “Hide out of stock products?”
Screenshot highlight option to hide out of stock products
  1. Click Apply
  2. Update the preview within the view to check your work
  3. Save the View
 
After these changes have been made to the View, any books that have a quanity of 0 in your LSI file will be automatically removed from the display. As you can see below, after we have added this filter, the first book in the View has been removed due to a stock level of 0.
Screenshot of frontpage booklist with 5 titles

 

D7 Taxonomy: 
Creating Content [2]
IndieCommerce [3]
Views (Advanced) [4]

Source URL:https://staging.bookweb.org/indiecommerce/filtering-views-stock-status

Links
[1] https://www.bookweb.org/indiecommerce/local-store-inventory [2] https://staging.bookweb.org/ic-d7-help/creating-content [3] https://staging.bookweb.org/ic-d7-help-d7-taxonomy/indiecommerce [4] https://staging.bookweb.org/ic-d7-help/views-advanced