Auto update stock_quantity when item is ordered

Hi there, Anyone know what hook / action I could use to update the stock_quantity in Algolia when a purchase is made?

Currently when someone’s buys something the stock_quantity is not updated in Algolia unless you go into the product backend and press update.

Using the latest version of Wordpress / Woocommerce.

Cheers

Hello @robert1

Please note: the Algolia wordpress plugin is no longer supported since 2019. There was a lot of issues notably with indexing and such.
See documentation on how to migrate: https://www.algolia.com/doc/integration/wordpress/getting-started/quick-start/?language=php

By default it should always sync wordpress post changes, however I’m not sure how it behaves with woocommerce on top.
See documentation for more info: https://community.algolia.com/wordpress/indexing-flow.html

Hey @samuel.bodin
Thanks for the response.

I’m not actually using that old plugin, I have modified the “WP Search with Algolia” by WebDevStudios plugin. Was just hoping someone else in the forum has Algolia indexing correctly with Woocommerce and could point me in the right direction of what action / hook i could use to trigger a re-index when a product has been sold.