Search code examples
algoliamagento2.4

Magento | Algolia Search | Add-To-Cart | Reloads | Ajax Failure


I have applied the following settings under Magento → Admin → Algolia Search

  • Enable Instant Search Results Page => Yes
  • Add to Cart => Yes

At the front-end, the search page behavior is surprising.

Click on the “Add-To-Cart” button the page reloads and success message appears.

The Ajax functionality doesn’t work at all the time.

Steps to reproduce:

  • Magento mini-search, search any term.
  • On the search page, click add-to-cart.
  • On the search page, input and search any term in the “Algolia mini-search”.
  • After results, click add-to-cart.

Please check the attached screenshots.

Thanks, enter image description here enter image description here


Solution

  • Finally, after many hours of efforts I’m able to resolve it. The solution is explained in this forum.

    https://discourse.algolia.com/t/magento-2-4-4-p2-search-page-add-to-cart-reloads-ajax-failure/18623

    Thanks,