Frontend
Is Enabled Determiner

Category Navigation

3min

When Category Navigation Ordering & Rendering is set the Klevu Theme is enabled for all Categories.

This behaviour can be amended by injecting custom isEnabledConditions into the isEnabledDeterminer.

The default behaviour of the determiner for category navigation checks:

  • If the store is integrated with Klevu
  • If category navigation is enabled
  • If the route is a category
  • If the category is displaying products
module-m2-frontend-categorynavigation/etc/frontend/di.xml


If all these return true, the category navigation layout handle will be added to the page.

Enable for a subset of categories

Say we only wanted to enable Klevu's Category Navigation if the category ID was odd.

Inject your own isEnableCondition

XML


Create the Condition

PHP


See module-m2-frontend-categorynavigation/Service/IsEnabledCondition for more examples of isEnabledDeterminer classes.