Reputation: 503
I managed to update Prestashop with data sent from my ERP made with PHP using the webservice that offers prestashop, but now I need to know how to detect changes in prestashop bd to update my ERP with those changes.
Can anyone offer me an introduction to the subject or some way of doing this? Thank you
Upvotes: 0
Views: 787
Reputation: 21
You should take a look at an external app that synchronizes information between Prestashop and ERP. The FamShop ecommerce platfom synchronizes products, prices, stocks, users and orders between ERPs and many other ecommerce systems.
Upvotes: 0
Reputation: 5748
Everything depends on what informations you want to retrieve from Prestashop.
You'll have to write a module which uses Prestashop Hook system.
For example if you want to inform your ERP about a new customer registration:
<?php
class ERPConnect extends Module
{
public function install()
{
return parent::install() && $this->registerHook('actionObjectCustomerAddAfter'); // This hook is called in /classes/ObjectModel.php > method add()
}
public function hookActionObjectCustomerAddAfter($params)
{
$customer = $params['object'];
MyErpConnector::sendNewCustomer($customer);
}
}
There are many hooks but there is no official list. You'll have to dig into the different classes (in /classes/) to find those you want to use.
Note that for any classes you can call the hook: actionObject[Object Name]AddAfter
.
Upvotes: 2