Introducing More Facets Per Category with Contextual Filters
Tags: ecommerce, search, bigcommerce, api
Published: 2021-02-24 21:03:47

---
title: Introducing More Facets Per Category with Contextual Filters
published: true
date: 2021-01-14 21:26:35 UTC
tags: ecommerce,search,bigcommerce,api
canonical_url: https://medium.com/bigcommerce-developer-blog/introducing-more-facets-per-category-with-contextual-filters-d7479daf7941
---

![](https://cdn-images-1.medium.com/max/1024/1*wA7Amd-2ua6KcXnBFagajw.jpeg)

### TL;DR

Contextual Filters allow for faceted search implementation on a BigCommerce storefront. To learn more, keep reading about the latest search updates available to BigCommerce merchants and developers.

### What are Contextual Filters

Contextual filters are an enhancement to optimize how faceted search filters on categories. This feature allows developers to create a better user experience for customers that are shopping on a complex merchant catalog. Leveraging the Contextual Filter feature you can also create a better search experience for product categories. Developers can configure Product Categories to have different enabled filters. The search enhancements allow shoppers to filter by relevant criteria as seen in the GIF below.

![](https://cdn-images-1.medium.com/max/786/0*leiFIB5QVql3kT3r)

### Developer Use Cases

When leveraging contextual filters the ultimate goal is to enhance the shopping experience of a customer. The improved search experience for shoppers allows developers and merchants to create a more relevant set of search parameters, which simplifies the shopping experience. When a shopper can find a product more effectively and quickly, they are more likely to purchase that product. More purchases mean developers can deliver more to their clients.

For example, if your merchant sold both shoes and bags, they would likely have some product attributes that are universal, such as color, fabric type, and designer. However, since shoes and bags have very unique features that don’t cross over, each would need its own attributes available to search by. Shoes may have attributes such as lace options, style (slip-on versus lace-up), and purpose (running versus basketball), whereas bags may have attributes such as number of straps, pockets, and volume.

Using the suite of APIs released as part of Contextual Filters, developers can automate more processes related to the management of storefront search. An example that comes to mind is connecting a Product Information Manager (PIM) to a BigCommerce Storefront. The PIM is the source of truth for the product data and the following APIs unlock the ability to not only keep BigCommerce and the PIM in sync but also ensures that the PIM’s filters are recognizable and searchable for product categories managed in that software.

Additionally, this unlocks a lot of creative solution-ing for implementations that require unique workflows. If the BigCommerce Control Panel user interface does not meet your development style you can now have options to work outside of that UI.

### Features of Contextual Filters

Developers can configure via API the settings for a Merchants user interface. In the [BigCommerce Developer API reference](https://developer.bigcommerce.com/api-reference/store-management/settings) for Settings you can:

- You can “Get” and “Update” the Storefront search settings.
- You can get all the available filters as well as the default filters that are applied.
- You can update the enabled product filters.
- You can “Get” and “Upsert” the contextual overrides for enabled filters.
- You can “Delete” a contextual filter applied to a product.

Plus, many more settings that unlock search capabilities beyond the above like:

- Sorting options values that are returned.
- Displaying names by a label for the storefront.
- Showing a number of values that are the best fit for the customer user group.
- Display options like the number of products returned from search.
- Areas of the user interface that you want to be collapsed by default and require the customer to engage and actively expand them.

This feature includes the following set of filtering on Category, Brand or Search pages:

- **Product Options** filters by product options.
- **Custom Fields** (Enterprise only) — filters by custom fields on products. Product options and custom fields that share the same name will be treated as a single filter. If names differ in case or spacing, they will be treated as different filters.
- **Category** filters by product category or sub-category; this is only used on Brand and Search pages.
- **Brand** filters by the product brand.
- **Price** filters by the base price of the product which does not include variant prices.
- **Rating** filters by product review rating and must be using BigCommerce’s product reviews.

Additionally, **Other** is a collection of other useful filters including:

- Filter the products with free shipping.
- Filter the featured products.
- Filter the products that are in stock.

### What is the Settings API

The [Settings API](https://developer.bigcommerce.com/api-reference/store-management/settings) is a set of endpoints that allows you to programmatically update elements of a store’s settings and configuration, which can affect the storefront or control panel experience. This new category of APIs expose settings that were previously only editable by a control panel user to public API consumers. These APIs are under active development and will be enhanced over time to progressively expose more control panel settings.

### Who Can Access Contextual Filters

Contextual Filters is a feature enhancement to BigCommerce’s existing Product Filtering feature. Therefore, its availability is limited to stores that already have access to Product Filtering. This includes merchants currently on Pro and Enterprise plans, as well as developer sandboxes in use by our partners. Product filtering with support for [Custom Fields](https://support.bigcommerce.com/s/article/Custom-Fields) is available to Enterprise plans only.

### Conclusion

Contextual filters are a great way to add value to a merchant's storefront experience especially when they have a large catalog that makes traditional searching difficult. As a developer, you have options to use the Settings API to automate these processes or to enable customization on a merchant by merchant basis. Once in use, you can then leverage the default user interface or create custom user interfaces or widgets for your search components.

### Resources

- API Documentation ([Contextual Filters](https://developer.bigcommerce.com/api-docs/store-management/settings/contextual-filters))
- API Reference ([Settings API](https://developer.bigcommerce.com/api-reference/store-management/settings), [Search Filters](https://developer.bigcommerce.com/api-reference/store-management/settings/search-filters))
- [Knowledge Base Article for the Control Panel User Interface](https://support.bigcommerce.com/s/article/Product-Filtering-Settings)
- [Developer Community](https://support.bigcommerce.com/s/group/0F913000000HLjECAW/bigcommerce-developers)
- [Developer Twitter](https://twitter.com/BigCommerceDevs)

* * *