PrestaShop Connector - Customer Update
This function synchronizes customer and address information from a PrestaShop instance to the App4Sales platform. It retrieves customer and address data via the PrestaShop API, applies various filters and transformations, and updates the corresponding App4Sales customer and address records. It also retrieves and caches language and country mappings, and certain configuration settings like the default currency.
Customer Core Fields
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| If the connector setting |
|
| If the connector setting |
|
| PrestaShop language ID is mapped to its ISO 639-1 alpha-2 code (e.g., 'en', 'nl', 'fr') using a helper method that queries the PrestaShop API for language details. |
|
| Initially set by concatenating |
Contacts
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| The PrestaShop customer ID is used as the contact ID. |
|
| |
|
| |
|
| |
| Derived | Concatenation of |
Addresses
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
| Hardcoded | Hardcoded to "vis" (visit address). |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| PrestaShop country ID is mapped to its ISO 3166-1 alpha-2 code (e.g., 'US', 'NL', 'FR') using a helper method that queries the PrestaShop API for country details and caches the mapping in |
Special Logic & Filters
**Customer Filtering:** Customers are filtered out if they are marked as deleted (
prestashop/customer/deleted == "1") or inactive (prestashop/customer/active != "1") in PrestaShop.**Shop Filtering:** Only customers belonging to the shop ID configured in the connector settings (
Settings.IdShop) are processed.**Address Clearing:** At the start of the update, any previously stored customer address links in the
KeySettingsContextare cleared (keys starting with "CustomerAddressLink_").**Parallel Address Processing:** The connector processes addresses in parallel to improve performance.
**Configuration Retrieval:** The value of the PrestaShop configuration
PS_CURRENCY_DEFAULTis retrieved and stored inKeySettingsContextunder the keys "CurrentVersion" and "CurrentCurrency".
Settings & Prerequisites
The following connector settings and internal contexts influence the behavior of the Customer Update process:
**
Id Shop**: This setting (configured in the connector) specifies the ID of the PrestaShop shop from which customers should be synchronized. Customers not associated with thisId Shopwill be skipped.**
Customer Code For Field**: This setting allows administrators to define which PrestaShop customer field should be used as the uniqueCustomerCodein App4Sales. If left empty, the internal PrestaShop customer ID is used.**
Application Key**: This key is used for authenticating all API requests to the PrestaShop instance.**
KeySettingsContext**: This internal context is used to cache country and language ISO code mappings from PrestaShop IDs, store the mapping between App4SalesCustomerCodeand PrestaShop customer ID, and to store the default currency from PrestaShop configuration.
Known Limitations
Only visit addresses are currently synchronized, hardcoded with
AddressType = "vis".There is no explicit handling for different address types (e.g., delivery, invoice) beyond the hardcoded 'vis' type.
Addresses are linked to customers based on the
id_customerfield from PrestaShop. If an address cannot be matched to a customer processed in the current run, it will be skipped.