Jump to content

[How To] call third party api on add order


chirag_0110

Recommended Posts

Hi,

 

One of my project has a requirement to manage inventory from third party app skubana which is known inventory management system.

 

So, I have to call the skubana API to add order, Add product, change order status etc from PrestaShop.

So, my question is how can I call Third party api in Prestashop whenever events occur (Add/edit product and all). I read about Prestashop hook, but do not have an idea about how to call it? Can anyone help me to do so.?

 

Thanks in advance.

 

Link to comment
Share on other sites

I assume that you're talking about Prestashop 1.7 since you didn't specified the version.
If you're talking about adding/editing/removing products that is done by the AdminProductsController (prestashop171/controllers/admin/AdminProductsController.php)
 
You'll see a lot of methods that start with ajaxProcess or process like ajaxProcessEditProductAttribute which is where you'll edit the product attribute or processAdd .

Link to comment
Share on other sites

I assume that you're talking about Prestashop 1.7 since you didn't specified the version.

If you're talking about adding/editing/removing products that is done by the AdminProductsController (prestashop171/controllers/admin/AdminProductsController.php)

 

You'll see a lot of methods that start with ajaxProcess or process like ajaxProcessEditProductAttribute which is where you'll edit the product attribute or processAdd .

Thanks for your response catalin.pop.

 

Yes I am talking about latest PS V1.7.2.2.

 

I think some confusion here. I don't want add/edit/delete product. But I want to trigger custom functions on these events. Then want to call third party API on add/edit/delete products.

 

Thanks,

Chirag

Link to comment
Share on other sites

Oh..Ok.
I think what you're looking for is Hooks http://doc.prestashop.com/display/PS17/Hooks+in+PrestaShop+1.7.x
Especially those that start with action

 

action. These hooks are triggered by specific events that take place in PrestaShop.

 

 

In your case you need to implement this methods in your module

 

actionProductAdd - This hook is displayed after a product is created

actionProductUpdate - This hook is displayed after a product has been updated

 

 

See the link I provided for a complete hooks list.

Link to comment
Share on other sites

Oh..Ok.

I think what you're looking for is Hooks http://doc.prestashop.com/display/PS17/Hooks+in+PrestaShop+1.7.x

Especially those that start with action

 

 

 

In your case you need to implement this methods in your module

 

actionProductAdd - This hook is displayed after a product is created

actionProductUpdate - This hook is displayed after a product has been updated

 

 

See the link I provided for a complete hooks list.

Okay..

 

For that I have to create custom module first right ?

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...