\FacetedCategory
This extension can be applied to ProductCategory to allow categories to have facets as well.
NOTE: You could apply this to either ProductCategory
or ProductCategory_Controller. I tend to use the model b/c
that will also cover some other cases like where you
might list subcategory products on the parent category page.
In such a case those products would be filtered as well.
- Author: Mark Guinn <mark@adaircreative.com>
Synopsis
class FacetedCategory
extends SiteTreeExtension
{
- // members
- private static array $db = ;
- private static array $facets = ;
- private static bool $show_disabled_facets_tab = true;
- private static string $products_method = 'ProductsShowable';
- private static bool $auto_facet_attributes = false;
- protected $_filteredProducts;
- // methods
- public void updateCMSFields()
- protected Controller getController()
- protected array getFacetSpec()
- protected array getFilters()
- public mixed FilteredProducts()
- public array getDisabledFacetsArray()
- public ArrayList Facets()
Hierarchy
Extends
- SiteTreeExtension
Members
private
- $auto_facet_attributes — bool
- $db
- $facets — array
- $products_method — string
- $show_disabled_facets_tab — bool
protected
- $_filteredProducts