Jump to content

[Solved]Call a custom script / function on purchase and product add


klmiop

Recommended Posts

Hi, and thanks for taking time to read my post.

 

Actually, i would like to be able to call something like a .php script, or even a function (php / ajax) when a product is purchased. The reason is that i want to update a custom database (not the one the shop will be using, but a complety unrelated one that i'm creating myself)

 

But i really don't have any idea where i should call my script / function to trigger it when a product is purchased, and i would also like to do the same when a product is added via prestashop's administration.

 

Also if what i'm asking is possible, am i going to be able to get something like the id of the purchased / added product ?

 

If you have any idea that could help me, it would be really appreciated.

 

Kind regards,

 

Nicolas.

Edited by klmiop (see edit history)
Link to comment
Share on other sites

I think you can use 'best practice' hooks in PrestaShop.

 

Here is a link to get your familiar with hooks

 

http://doc.prestashop.com/display/PS16/Managing+Hooks

 

Well i'm feeling a bit dumb, that's exactly what i was looking for.

 

I guess i used the wrong keywords while searching, i went for "callback events" but it didn't helped me.

 

Thank you very much, you saved me :)

 

Have a great day !

 

(I clicked on "Mark Solved" on your post, i hope that's how i show that my problem is solved)

 

Best regards

 

Nicolas.

  • Like 1
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...