Jump to content

How can i run class from Prestashop WebService


Recommended Posts

So here is my problem. I have a class created that extends AdminProductsControllerCore. What it does is if you have one product that you want to split in 3 different products but have the same stock, it will have 1 master and 2 slaves. For example: You have reference - N101 that has stock 100, but you want to have 3 products with different reference N100FR and N100DE.

What the new class does is that if you link the 3 products, all will have the same stock. As soon as you change the stock for one, it will also change it for the other 2.

We also have a connection to a fulfillment system that manages the warehouse stock. This means that the Fulfillment software is connected through WebService to Prestashop and every change in the Fulfillment system to the stock is being sent to Prestashop. This also works very good. Also to be noted that in the Fulfillment software we have multiple systems linked to import orders, not just prestashop so it means that some orders are never in prestashop, but the stock drops.

Now comes the problem:

If i manually (or by new order) change the stock in Prestashop, all products change qty to the new value. But if the qty changes in the Fulfillment system, only the master sku changes stock in Prestashop. So this actually means that the new class that changes the stock when it's manually done in Prestashop (or by creation of new order) does not work.

My question is how can i make it that when the stock is changed, that the class that i created will run?

If there is need for more details, please let me know.

Thanks in advance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...