Frontend

Is Enabled Determiner

3min

Klevu/Frontend/Service/IsEnabledDeterminer.php determines if we should output to the frontend.

We pass a multi-dimensional array of Klevu\FrontendApi\Service\IsEnabledCondition\IsEnabledConditionInterface to the determiner.

And Condition

Any condition at the top level of the array is treated as an AND condition. e.g.

Klevu/Frontend/etc/frontend/di.xml


Here we only output the customer price group suffix if both this store is integrated with Klevu and Customer Group Pricing is enabled in the admin.

Or Condition

Any condition at any lower level of the array is treated as an OR condition. e.g.

Klevu/FrontendSearch/etc/frontend/di.xml


Here we output the currency conversion javascript if either quick search or search results landing page are enabled as they both require currency conversions.

Combining And & OR

As each module injects its own configuration that consolidated CurrencyConversion XML will look like this

XML


Here we only output the currency conversion javascript if Both klevu_integrated - the store is integrated with Klevu AND klevu_modules_enabled - at least one of these options is enabled. Either klevu_catnav_enabled - Category Navigation is rendered with Template JS OR klevu_recs_enabled - Recommendation is enabled OR klevu_quick_enabled - Quick Search is enabled OR klevu_srlp_enabled - Search Result Landing Page is rendered with Template JS

i.e. If the store is integrated and one of the options that requires currency conversion is enabled.