Add to cart button in algolia autocomplete

Hello,

I am looking to implement an add to cart button in the algolia autocomplete and i have followed the recommendation of a previous thread however it is not working any recommendations on the best way to do this?

Thanks