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/di 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 klevu/frontendsearch/etc/di 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 \<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 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