override stock update function in PrestaShop

293 Views Asked by At

I want to override stock update function of the core files of PrestaShop. I don't know where it is located in the files.

basically, I want to call an external API when the stock of the products is updated. (only when the stock is updated, like when a product is purchased or manually product stock update through backend ).

1

There are 1 best solutions below

1
Alexander Grosul On

I think you don't need to override anything. It's better to create a module and use available hooks to manage your requirements, such as actionObjectOrderAddAfter, actionOrderStatusPostUpdate, actionOrderStatusUpdate within front-end and actionObjectProductAddAfter, actionObjectProductDeleteAfter, actionObjectProductUpdateAfter.