Magento 2. Modify product price in search



Good evening.

Products loading by search or on category page. I use algolia. But when in loading process I need to change price of each product.

Firstly I need to get ids of products from use Algolia. How to get them?

Secondly I need to get prices from some external resource by these ids.

Thirdly need to change price of each id.

I know need to use some event.

At this moment I have added and included algoliaPrice.js to my magento module:

requirejs(['algoliaBundle'], function (algoliaBundle) {
    algoliaBundle.$(function ($) {
        var algoliaConfig = window.algoliaConfig;

So how to get ids of products from search use algolia functionality?

Thanks for any help and advise.


Hello @faltsman,

There are some javascript frontend hooks to help you customize your results :

We also created a customization extension to help customers :

But I guess, the easiest way to update your prices should be at indexing time with the backend hooks :

Example :

Hope this would help.

But I guess