Formatting Minimal Prices on Magento 2

Using the Magento 2 module: for configurable products we are not getting a default formatted price, meaning we are having to use the field “minimal_price”. Is it possible to send this field over formatted? We are loosing trailing zeros and decimal places as it is sent over as what seems to be a float value rather than a price string.

Hello @darren.brooks,

the extension doesn’t have this feature out of the box, but you can transform the attribute programmatically.
The best way is to use algolia_after_create_product_object backend hook, write a listener method where you can place a code to enrich the $record with formatted minimal price.

You can learn how to write the listener method in Customize Algolia extension tutorial.

When you do that, reindex your data.

If you’ll index the formatted price to a new attribute, don’t forget to override the template to use the new attribute.

If you don’t want to index an extra attribute for formatted minimal price, you can extend transformHit function to modify the value of minimal price attribute or to add a new attribute with formatted value on the front-end.