---
title: Is Enabled Determiner
slug: klevu-magento-v4/frontend-is-enabled-conditions
docTags: 
createdAt: 2024-08-15T10:34:02.322Z
---

`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.

:::CodeblockTabs
Klevu/Frontend/etc/di.xml

```xml
<type name="Klevu\Frontend\ViewModel\CustomerGroupSuffix">
    <arguments>
		<argument name="isEnabledConditions" xsi:type="array">
		    <item name="klevu_integrated"
		          xsi:type="object">Klevu\Frontend\Service\IsEnabledCondition\IsStoreIntegratedCondition</item>
		    <item name="klevu_customer_group_price_enabled"
		          xsi:type="object">Klevu\Frontend\Service\IsEnabledCondition\IsCustomerGroupPriceEnabledCondition</item>
		</argument>
	</arguments>
</type>

```
:::

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.

:::CodeblockTabs
Klevu/FrontendSearch/etc/di.xml

```xml
<type name="Klevu\Frontend\ViewModel\CurrencyConversion">
    <arguments>
        <argument name="isEnabledConditions" xsi:type="array">
            <item name="klevu_modules_enabled" xsi:type="array">
                <item name="klevu_quick_enabled"
                      xsi:type="object">Klevu\FrontendSearch\Service\IsEnabledCondition\IsQuickSearchEnabledCondition</item>
                <item name="klevu_srlp_enabled"
                      xsi:type="object">Klevu\FrontendSearch\Service\IsEnabledCondition\IsSrlpEnabledCondition</item>
            </item>
        </argument>
    </arguments>
</type>

```
:::

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
<type name="Klevu\Frontend\ViewModel\CurrencyConversion">
    <arguments>
        <argument name="isEnabledConditions" xsi:type="array">
            <item name="klevu_integrated" xsi:type="object">Klevu\Frontend\Service\IsEnabledCondition\IsStoreIntegratedCondition</item>
            <item name="klevu_modules_enabled" xsi:type="array">
                <item name="klevu_catnav_enabled"
                      xsi:type="object">Klevu\FrontendCategoryNavigation\Service\IsEnabledCondition\IsCatNavEnabledCondition</item>
                <item name="klevu_recs_enabled"
                      xsi:type="object">Klevu\FrontendRecommendations\Service\IsEnabledCondition\IsRecommendationsEnabledCondition</item>
                <item name="klevu_quick_enabled"
                      xsi:type="object">Klevu\FrontendSearch\Service\IsEnabledCondition\IsQuickSearchEnabledCondition</item>
                <item name="klevu_srlp_enabled"
                      xsi:type="object">Klevu\FrontendSearch\Service\IsEnabledCondition\IsSrlpEnabledCondition</item>
            </item>
        </argument>
    </arguments>
</type>

```

Here we only output the currency conversion javascript if&#x20;
**Both**&#x20;
&#x20;   `klevu_integrated` - the store is integrated with Klevu&#x20;
**AND**&#x20;
&#x20;   `klevu_modules_enabled` - at least one of these options is enabled.
&#x20;       **Either** ****
&#x20;       `klevu_catnav_enabled` - Category Navigation is rendered with Template JS
&#x20;       **OR**&#x20;
&#x20;       `klevu_recs_enabled` - Recommendation is enabled&#x20;
&#x20;       **OR**&#xA;**&#x20;       &#x20;**`klevu_quick_enabled` - Quick Search is enabled
&#x20;       **OR**
&#x20;       `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.

