Modify Search Response
To modify a search response, the incoming response object is intercepted and any of the available datapoints can be manipulated as needed prior to being sent to the UI templates.
There are two steps:
-
Intercept the incoming response object
-
Identify the data object to be modified
Any of the product attributes are available to be modified as needed or otherwise inject any custom values.
Use the klevu.modifyResponse function to intercept the response data.
The simplest way to get acquainted with the available data is to use console.log and review the output.
For example, the following snippet loops through each record in the productList result for the search landing page scope and changes the price of the item in index position "999.00"