neuhs Posted December 3, 2020 Share Posted December 3, 2020 Hi, I am creating a module that integrates with an online POS system which uses API and webhooks. Whenever there is an event (e.g.: change in product quantity), the request will be automatically via webhook from the external POS. But, I am unsure how I can create the Prestashop module that interacts with the external webhook (i.e.: how do I know that a request has been pushed via webhook to perform certain actions on Prestashop)? Anyone have any idea how I can go about doing this? Thanks in advance! Link to comment Share on other sites More sharing options...
Miguel86 Posted December 3, 2020 Share Posted December 3, 2020 If i understand right what you expect is that when some changes quatity of a product make a remote call to the POS? Link to comment Share on other sites More sharing options...
Guest Posted December 3, 2020 Share Posted December 3, 2020 (edited) I do not understand it. What does POS mean? Do you have a cash register or touch screen? In the cash register system you have the same products uploaded as in the eshop and the PLU code in the POS system is the same as the SKU of the product in Prestashop? Please write all the information in more detail. Please write down your idea in detail with explanatory points. Edited December 3, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
neuhs Posted December 4, 2020 Author Share Posted December 4, 2020 Okay, the module I created integrates Prestashop with an online POS (Point-of-sale) system. The online POS has a webhook that pushes JSON data whenever the "inventory update" event happens in that online POS. What I would want to do is to update the inventory accordingly for these products that have an update in their inventory. Initially, I couldn't figure what functions and classes that I have to create within the Prestashop module for the webhook to work. But, now I figured out that I can create a front controller within my module. So as of now, when the an inventory update happens my function in the front controller will be able to run successfully. However, I'm stuck with not knowing how to take and process the JSON data that will be sent to the postProcess() function in my front controller. Any one have an idea on how I can go about doing this? Link to comment Share on other sites More sharing options...
neuhs Posted December 4, 2020 Author Share Posted December 4, 2020 Okay, nevermind. I think I managed to solve it. I just needed to add Tools::getValue(...) to get the json data and work from there. Thanks you both for trying to help! 😀 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now