简体   繁体   English

Prestashop模块API

[英]Prestashop Module API

I need to create a module in Prestashop. 我需要在Prestashop中创建一个模块。

The module should have the following functionality. 该模块应具有以下功能。

1) When a user registers a account, buys a product.. etc the data should be also passed through an API to another System which has a database. 1)当用户注册帐户,购买产品等时,数据也应该通过API传递给另一个拥有数据库的系统。

2) I have heard about the REST API of the Prestashop. 2)我听说过Prestashop的REST API。

3) The main challenge is that this should all be within the scope of the Module and no core file or external file should be edited of the Prestashop. 3)主要的挑战是这应该都在模块的范围内,并且不应该编辑Prestashop的核心文件或外部文件。

4) Searched the internet but found no result which satisfies the requirement. 4)搜索互联网但未发现满足要求的结果。

Any, Help or ideas how this can be achieved. 任何,帮助或想法如何实现这一目标。

thanks.. 谢谢..

This can be achieved using Prestashop hooks, almost all actions a customer performs in front office have it's own hook, which is invoked in your module when an action is perfomed. 这可以使用Prestashop挂钩实现,客户在前台执行的几乎所有操作都有自己的挂钩,当执行操作时会在模块中调用。 Check Prestashop documentation on hooks 检查钩子上的 Prestashop文档

In the case you describe here, you could rely on the Hook actionPaymentConfirmation. 在此处描述的情况下,您可以依赖Hook actionPaymentConfirmation。 As soon as an order is placed in Prestashop and its status is set to 'Payment accepted', your module could post the order details to your system. 只要订单放入Prestashop并且其状态设置为“已接受付款”,您的模块就可以将订单详细信息发布到您的系统。 Your Prestashop instance is then a web client to your Master system.According to me, Prestashop REST API won't help here! 您的Prestashop实例是您的Master系统的Web客户端。据我所知,Prestashop REST API在这里没有帮助!

You may setup your system the other way around with the REST API, but you have to check at a regular basic the status of orders, and so one. 您可以使用REST API以相反的方式设置系统,但是您必须在常规基础上检查订单的状态,等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM