Developers/Translate values for searching items/en

Translate values for searching items
Sometimes, the values used by the MShop framework (e.g. salutation constants: "company", "mrs", "miss", "mr") are different from the values used by external sources (e.g. only "m"/"f" for male/female). Searching for the constants from the MShop framework would find no results in this case. Therefore, it's necessary to transform the MShop framework values to the values of the external source before executing the search statement. Fortunately, there is a way provided by criteria plug-ins to create this mapping. You have to implement such a criteria plug-in first:

The searchItems method of the manager has to be adapted to create the criteria plug-in and hand it over to the getConditionString method of the given criteria object implementing the MW_Common_Criteria_Interface:

It's important that the $plugins variable is an associative array. The key for each plug-in has to be the name of the code for searching whose value we wish to translate.