How to gets information about the filters currently applied on the search page

Description : Gets information about the filters currently applied on the search page. This method works only when the current view is the search page. On the initial page load of the product list page, this method returns an empty array (no filters are set)

var plp = container.getComponent('PLP');
plp.getFilters();

// Example of the array of objects returned by getFilters();
[
  {
    config: {},
    id: "custitem30",
    isParameter: false,
    url: "custitem30",
    value: [
      "Small"
    ]
  },
  {
    config: {},
    id: "custitem40",
    isParameter: false,
    url: "custitem40",
    value: [
      "Sportswear"
    ]
  }
]

Leave a comment

Your email address will not be published. Required fields are marked *