The XY-Connect Cegid Retail SaaS connector consists of a PrestaShop module " XY-Connect for Cegid SaaS " including two PHP scripts " import.php " and " export.php ".
This PrestaShop connector allows you to:
transmit data from Cegid Business Retail to PrestaShop
Retrieve new PrestaShop orders in Cegid
Data exchanges use CSV format feeds for data imports and XML via SOAP web services provided by Cegid.
Since version 3.0.0 of the module, a new rfe.php script is available to allow the retrieval of flat files saved in the Cegid RFE tool.
If you are using the Cegid RFE solution for transmitting flat files, you will need to call the rfe.php script to download the CSV files into PrestaShop, and then import.php to launch the import of these files.
The advantages for e-commerce merchants
With the " XY-Connect for Cegid SaaS " module, you gain in productivity, consistency and peace of mind:
Your online catalog, including prices and stock levels, is up-to-date with your CEGID database.
Articles and variations unpublished in Cegid are automatically deactivated on your PrestaShop store
You reduce the risk of inconsistencies between your Cegid database and your PrestaShop database
You save time by no longer having to re-enter the data
Your web orders are automatically integrated into Cegid, optimizing your order processing times.
GDPR compliant: the connector simply does not store your data! It acts as a gateway between your website and your Sales Management system.
Simplicity and clarity: you manage your data from Cegid and enrich it in PrestaShop. No third interface to use.
Features
Full control over data exported from Cegid to the PrestaShop store (e.g., type of stock taken into account, import of prices including VAT, etc.)
You can choose which category to import items into in PrestaShop, and you can disable the category to enrich the data before making them available to your customers.
Ability to add and remove data within CSV import flows (e.g., adding a column for importing a feature)
Synchronization of declined items
Import of item packs with component and quantity management
Updating customer records in Cegid during order import
Synchronization of the customer's primary address
It is possible to import item discounts via a dedicated CSV feed and associate them with specific markdown codes, including for customer groups.
After the first synchronization, you can choose to import only the data that has changed since the last synchronization for faster data processing.
Synchronization logs can be easily viewed from the back office via a dedicated menu.
Creation of Cegid documents (delivery preparation, customer delivery) directly from the order form in the PrestaShop back office, via the change of order statuses (preparation in progress, shipped)
Order return management: export to Cegid and import of return statuses
Import of orders placed in physical stores into PrestaShop, with management of store returns
Option to disable feeds you don't need
Support for the Cegid RFE tool for downloading flat files
Management of the "(WebXY) Gift Cards" module for exporting orders containing gift cards
Prerequisites
The following items are necessary for the module to function correctly.
Web prerequisites
PrestaShop version 1.7.8 or higher (compatible with PrestaShop 9)
PHP version 7.4 or higher
PHP SOAP library installed
The /modules/xyconnectcegid/ folder and its subfolders must be writable.
Cegid prerequisites
Creating an item in Cegid, not held in stock, which will contain PrestaShop items without a reference number
Creating a non-stock item in Cegid that will contain the shipping costs for PrestaShop orders
Creation of an item in Cegid, not held in stock, which will contain the amount of the cart discounts (cart rules in PrestaShop)
Creation of an item in Cegid, not held in stock, which will contain the price of gift wrapping.
A reason for markdowns for online web discounts
If you do not wish to import orders as tickets into Cegid, you will need to activate the "eCommerce Management" module in Cegid.
The currency codes used in the e-commerce store must be strictly identical to the PrestaShop ISO code (e.g., the code "EUR" for the Euro currency).
Functioning
As previously mentioned, the connector consists of a PrestaShop module containing a script for importing data into PrestaShop and a second script for exporting data to Cegid.
These data exchanges are carried out according to the following formats:
CSV
XML, via Cegid web services
Below is the list of data exchange feeds available for the Cegid / PrestaShop connector:
Flux
Nom technique
Type d'échange
Format d'échange
Disponible depuis la version
Description
Customers
customer
import
CSV
3.0.0
Importing Cegid customers into PrestaShop
Items
product
import
CSV
1.0.0
Importing items and variations into PrestaShop
Packs
pack
import
CSV
3.0.0
Converting existing items into bundles
Establishments
store
import
CSV
1.0.0
Importing Cegid establishments into PrestaShop
Stocks
stock
import
CSV
1.1.0
Import of stock items and variations
Item discounts
specific price
import
CSV
1.0.0
Import item discounts as specific prices into PrestaShop
Store orders
storeOrder
import
CSV
3.0.0
Importing store orders (Cegid) into PrestaShop
Return status
orderReturnStatus
import
Web service
3.0.0
Order return status update
Order status
orderstatus
import
Web service
1.0.0
Order status update
Customers
customer
export
Web service
3.0.0
Export of PrestaShop customers who have never placed an order (disabled by default)
Orders
order
export
Web service
1.0.0
Exporting PrestaShop orders to Cegid via web services
Returns
return
export
Web service
3.0.0
Exporting order returns from PrestaShop to Cegid
Order status
orderstatus
export
Web service
4.0.0
Exporting order statuses to Cegid (disabled by default)
Importing CSV data
To import data via CSV files, the module has a subfolder streams/ intended to contain the CSV files retrieved during data imports into PrestaShop.
It is possible to create a subfolder for each import flow (item, stock, discounts etc.) and to place the corresponding CSV files in these subfolders.
The directories for depositing CSV files can be configured for each of these streams.
At the end of the CSV file imports, they are moved inside the streams/archives/ directory.
IMPORTANT: the customer is responsible for uploading CSV files from Cegid to PrestaShop.
To start a manual CSV data import, simply copy the import URL (available within the module configuration page) into your browser.
You can set up an automatic import of CSV data via the implementation of a CRON task.
It is recommended to set the import frequency to 5 to 10 minutes after uploading the CSV file to the web environment.
Export of XML data
Data export is done via the PHP SOAP library.
To start a manual data export, simply copy the export URL (available within the module configuration page) into your browser.
You can set up an automatic data export by setting up a CRON job.
Regarding the export of PrestaShop orders to Cegid, these are automatically sent to Cegid according to the following rules:
The most recent order status must be one of the following:
Payment accepted
Awaiting restocking (paid)
Remote payment accepted
The order must not have been flagged as being synchronized in Cegid.
To force the synchronization state of an order to "not synchronized", you can go to the back office, to the " Xy Connect - associations " menu > " Orders " and then click on the "Yes" button of the corresponding order (see screenshot below).
List of orders synchronized in Cegid
Targeted execution of a single stream
Available since module version 3.0.0
It is possible to run only one import or export stream at a time by adding the stream parameter to the URL. This allows you to control the order in which the streams are executed and gives you greater flexibility in configuring your cron jobs.
Available since version 3.0.0 of the module (for exports) and 4.0.0 (for certain imports via Webservice)
The dry_run=1 parameter allows you to simulate an import or export without making the actual changes. This lets you verify that the flows are working correctly before running them in production.
The " Global " tab of the module configuration page contains the following settings:
Token . Security token used to authenticate calls to the module's scripts.
Debug mode (yes/no). If enabled, detailed errors will be displayed during data imports and exports.
Keep logs for X days . Synchronization log retention period (in days). Older logs will be automatically deleted.
Product parameters
Available since version 4.0.0 of the module
The " Products " tab on the module configuration page contains the following settings:
Automatically deactivate new products (yes/no). If enabled, new items will be automatically deactivated upon import into PrestaShop. This allows you to enrich product descriptions before making them visible to your customers.
Disable label updates for existing products? (yes / no). If enabled, the labels of products already present in PrestaShop will not be overwritten during subsequent synchronizations. (Available since version 4.2.0)
Stock parameters
Available since version 4.0.0 of the module
The " Stocks " tab on the module's configuration page contains the following parameter:
Add stock lines during import (yes/no). If enabled, stock lines for the same item/variant will be added together before updating the stock. This is necessary if your Cegid export does not aggregate warehouse stock levels before exporting to the CSV file. If this setting is enabled, the connector will import stock files one by one.
Category settings
The " Categories " tab on the module configuration page contains the following settings:
Synchronize product/category associations (yes/no). If disabled, synchronized products will only be associated with the default category.
Category search (based on name/ERP code/PrestaShop ID). This method is used to search for categories when associating products with categories. (Available since version 4.0.0)
Root category of synchronized products . Categories imported from Cegid will be saved under this parent category (selection via a category tree).
Synchronize associations only for new products (yes/no). If disabled, product/category associations will be reset each time a product is synchronized.
Reset all product/category associations (yes/no). If disabled, only associations originating from Cegid will be reset.
Price parameters
The " Price " tab on the module configuration page contains the following parameters:
Price of products exported from CEGID excluding tax (yes/no). If disabled, the module will recalculate the price excluding tax based on the store's default country. Disabling this setting may result in price differences when importing products from Cegid. (Available since version 1.12.0)
Price of discounts exported from CEGID excluding tax (yes/no). If disabled, the module will recalculate the pre-tax price of discounts based on the product's tax rule. Disabling this setting may result in price discrepancies when importing discounts from Cegid. (Available since version 1.10.0)
Override existing specific prices (yes/no). If disabled, Cegid discounts will not be created if a specific price already exists in PrestaShop.
Recalculate discount percentages (yes/no). If enabled, the module will automatically recalculate discount percentages when the product price is updated but the discount value is not provided. Enabling this setting may result in price discrepancies when importing orders into Cegid.
Distribute cart rules across products (yes/no). If enabled, the cart rule amount will be distributed across each product in the customer's order.
Command settings
The " Commands " tab of the module's configuration page contains the following parameters:
Import tickets (yes/no). If enabled, PrestaShop orders will be imported into Cegid as tickets (instead of orders). If this setting is enabled, the "Order Status" feed will be disabled. (Available since version 1.13.0)
Use EAN 13 code as identifier (yes/no). If enabled, the EAN 13 code will be used to identify items/variations when exporting order lines instead of the PrestaShop reference.
Separate items from packs (yes / no). If enabled, items from packs will be separated into X lines based on components when exporting orders.
Separate cart rules (yes/no). If disabled, cart rules will be grouped into a single discount line when exporting orders.
Use of Cegid's native shipping costs (yes/no). If enabled, shipping costs will be stored in the Cegid document footer ( PIEDPORT ). If disabled, shipping costs will be stored as a separate line item.
Automatically deliver exported orders (yes/no). If enabled, exported orders will be automatically marked as customer deliveries in Cegid.
The settings "Use EAN 13 code", "Separate items from packs", "Separate cart rules", "Native shipping costs" and "Automatically deliver" are available from version 4.0.0 of the module.
Gift card settings
Available since version 4.0.0 of the module
The " Gift Cards " tab on the module's configuration page contains the following setting:
Gift card payment code . If entered, this code will be used for payments made with a gift card when exporting orders. This setting is compatible with the "(WebXY) Gift Cards" module.
Cegid database login credentials
In order to send PrestaShop orders to Cegid, the following fields must be completed:
The root URL of the Cegid web services . This is your entry point to the Cegid Retail application (without the port), usually displayed in the application's title bar (e.g., https://123456-retail-ondemand.cegid.cloud/Y2/ ).
CEGID Login . This is your login (including domain) within the CEGID Retail application (e.g., MY_DOMAIN\LOGIN ).
CEGID password . This is the password to access the Cegid application.
Since version 3.0.0 of the module, it is possible to configure access to the Cegid test and production databases directly from the module's configuration page. A switch allows you to change the module's access mode to Cegid (test/production).
Prefixes
In order to distinguish new customers and web orders from data already present in Cegid, customer and order code prefixes must be put in place.
By default, internal reference prefixes for orders (parameter " Order Prefix ") and customer codes (parameter " Customer Prefix ") are defined on WEB .
These prefixes cannot exceed 6 characters.
Therefore, a customer who has placed an order but does not exist in Cegid will have a customer code starting with the prefix configured in the back office ( WEB default). The internal order reference will also begin with the prefix defined in the back office ( WEB default).
Markdown reason for specific PrestaShop prices
When an item in the order is discounted, the module uses a specific markdown pattern for web discounts.
Markdown patterns can be found in the "Settings" > "Front-office" menu and then "Markdown pattern" in Cegid.
Example of a markdown pattern for online discounts per item
When the markdown pattern has been created in Cegid, its code must be copied (field “ Markdown pattern ” in the screenshot above) and entered in the CEGID default product discount type parameter of the PrestaShop module.
Since version 1.10.0 of the PrestaShop module, it is possible to export CEGID discounts to a separate feed. The markdown codes retrieved from Cegid during order import will therefore be automatically synchronized according to the discounts applied in PrestaShop.
The CEGID default product discount type setting will only be used for discounts created directly in PrestaShop.
Items for storing miscellaneous items, shipping costs, packaging, and shopping cart discounts
As previously mentioned in the Cegid Prerequisites section, 4 articles must be created in Cegid to store:
miscellaneous items
shipping costs
paid gift wrapping
basket discounts
These items should not be held in stock
When the miscellaneous item has been created, its code (field " Item code ") must be copied and entered in the " Miscellaneous product code in CEGID " parameter of the PrestaShop module.
When the shipping cost item has been created, its code (field " Item code ") must be copied and entered in the " Shipping cost product code in CEGID " parameter of the PrestaShop module.
When the gift packaging item has been created, its code (field " Item code ") must be copied and entered in the " Product code for gift packaging in CEGID " parameter of the PrestaShop module.
When the web discount item has been created, its code (field " Item code ") must be copied and entered in the " Product code for discounts in CEGID " parameter of the PrestaShop module.
Export of articles
Two parameters are available for exporting commands:
E-commerce establishment code. Orders exported from PrestaShop will be associated with this Cegid establishment.
Central warehouse code ( OPTIONAL ). Orders exported from PrestaShop will be associated with this delivery warehouse.
Since version 4.0.0 of the module, an additional parameter is available: E-commerce establishment code for returns . If this parameter is not specified, the main e-commerce establishment code will be used for order returns.
CSV import paths and filenames
It is possible to change the CSV file import folders from the module configuration page.
By default, the path is "/modules/xyconnectcegid/streams/" but it is possible to separate the streams by folder (see the example below).
Configuring CSV file paths for certain connector streams
The CSV file name prefix settings allow you to restrict the CSV files imported into the PrestaShop store.
For example, if the " Product file name prefix " setting is set to products_ , only files whose name starts with products_ will be imported into PrestaShop.
When a CSV file is imported into PrestaShop, it is moved to the /modules/xyconnectcegid/streams/archives/YYYY-MM-DD/ folder. It is also renamed to prevent direct remote access.
Splitting large CSV files
Available since module version 3.0.0
For very large CSV files, a csvsplitter script is available to automatically split CSV files awaiting import into several smaller files of up to 2000 lines each. This prevents memory overflows or execution time issues during import.
It is recommended to call this script before the import script if your CSV files are likely to contain a large number of lines.
Data association between Cegid and PrestaShop
Since PrestaShop and Cegid are two different environments, manual associations must be made before order synchronizations can be launched.
These associations concern the following elements:
Titles of civility
Payment methods
Country
Taxes
Carriers
Customer groups
Titles of civility
In Cegid, the management of salutations is located in the " Settings " > " Customers " menu, then " Salutations ". In PrestaShop, this setting is located in the " Shop Settings " > " Customers " menu, then " Salutations ".
Code association management is located within the PrestaShop back office, under the menu " Xy Connect – associations " > " Titles of address ". Clicking the + button allows you to add a new association.
Add a caption...
Payment methods
In Cegid, payment method management is located within the " Settings " > " Management " menu, then " Payment Methods ". In PrestaShop, it encompasses all payment modules.
Payment method associations are also based on the currency used when paying for the order. This means that it is possible to assign a PrestaShop payment module to multiple payment methods in Cegid, depending on the currency.
Code association management is located within the PrestaShop back office, under the menu " Xy Connect – associations " > " Payments ". Clicking the + button allows you to add a new association.
Payment methods associated between PrestaShop and Cegid
Since version 1.14.0 of the connector, it is possible to assign customized payments to Cegid payment methods.
This allows you, for example, to assign orders imported from marketplaces such as Amazon, Cdiscount, etc., via a single module, to several payment methods in Cegid (examples highlighted in blue in the screenshot above).
Country
In Cegid, country management is located in the menu " Settings " > " General " > " Countries ". In PrestaShop, the association between CEGID country codes and PrestaShop ISO codes is done in the menu " Xy Connect – Associations " > " Countries ". Clicking the + button allows you to add a new association.
This setting allows the country to be identified when creating customer addresses in CEGID during customer creation and order retrieval.
Countries associated between PrestaShop and Cegid
Warning! You must check the associations for each country served by your carriers.
Tax codes
From the PrestaShop item import feed, you can specify the Cegid VAT used (e.g., normal, reduced…) for each product in order to associate them with the different PrestaShop tax rules.
To do this, it is necessary to use the tax association menu which is located in the back office, menu " Xy Connect - associations " > " Taxes ".
Clicking the + button allows you to add a new association.
image.png
If no VAT code is specified when importing items, a tax rule will be chosen based on the store's default country. This association will then only be applied to new products.
Carriers
Available since module version 3.0.0
When exporting orders from PrestaShop to Cegid, a carrier code is used to synchronize the carrier. The association between a code and a carrier is configured in the carrier association menu located in the back office, under " Xy Connect – associations " > " Carriers ".
Please note that the field used for carrier synchronization is only present within the Cegid Omnichannel module. Therefore, if the "Import tickets" option is enabled, the carrier code will not be exported.
Clicking the + button allows you to add a new association.
image.png
Customer groups
Available since module version 3.0.0
When importing/exporting clients, a client group code is used to synchronize the default group associated with the different clients. The association between a code and a client group is configured in the group association menu located in the back office, under " Xy Connect – associations " > " Groups ".
image.png
Data exchange flow
These exchanges are done using the import.php scripts (for processing data imported from Cegid) and export.php (for sending data from PrestaShop to Cegid).
Since version 3.0.0 of the module, a new script rfe.php , is used to download files stored in Cegid RFE. Therefore, it is possible to process files stored in Cegid RFE by running the rfe.php script to download the flat files and then import.php to process them.
These files are located inside the /controllers/front/ folder and are accessible by default via the following URLs:
The security token value is generated randomly and automatically upon module installation and is available on the module's configuration page.
Each data stream is available within 2 configuration files in JSON format.
An import.json file contains all the data flows from Cegid to PrestaShop. An export.json file contains the data flows from PrestaShop to Cegid.
These 2 files are specific to each shop and are available within the "/config/ ID_SHOP /" folder of the module where ID_SHOP corresponds to the PrestaShop shop identifier.
As a general rule, physical deletions should not be performed at the Cegid database level; it is preferable to carry out logical deletions (closing of items / customers / etc.).
Importing customers into PrestaShop
Title
Title
Configuration file
import.json
Stream name
customer
Type of exchange
CSV
By default, this is how the connector imports CSV data related to clients.
JSON Key
Data
Column index
Comment
code_erp
Customer code
1
Unique customer identifier
customer_email
E-mail
2
lastname
Surname
3
firstname
Last name
4
closed
Farm
5
Active or inactive customer
title_id
Title of civility
6
Client's civility title code
siret
SIRET number
7
ape
APE code
7
birthday_year
Year of birth
9
Four characters long (e.g., 1991)
birthday_month
Month of birth
10
Two characters (e.g., 09)
birthday_day
Birth date
11
Two characters (e.g., 01)
optin_email
Opt-in & Newsletter Subscription
12
See below for explanation
last_modification_date
Customer modification date
13
Used to determine which email address is the most recent between Cegid and PrestaShop
default_group
Default client group
14
Customer group code
Managing newsletter subscriptions & sharing data with partners
The synchronization of these 2 data depends on the value of the optin_email field.
1. Newsletter subscription
If the field value matches BrandOnly , UsableByBrand , or ForPartners , then the customer is subscribed to the newsletter.
2. Sharing data with partners
If the field value corresponds to ForPartners , then the customer authorizes the sharing of their data with partners.
Importing items into PrestaShop
Title
Title
Configuration file
import.json
Stream name
product
Type of exchange
CSV
Only individual, dimensioned items are transferred from Cegid to PrestaShop. Generic items are not synchronized. During import into PrestaShop, if an item is "inactive" (i.e., closed or invisible to e-commerce) and does not exist in the PrestaShop database, then it is ignored.
The " Article Code " field in Cegid populates the "Reference" field in PrestaShop. Note that the PrestaShop "Reference" field only contains 32 characters, therefore using the fifth dimension of CBR-sized articles is incompatible with the module's proper functioning.
Therefore, a declined item cannot have more than 4 groups of attributes at the same time.
By default, the connector uses the Cegid article code field as the unique key for synchronizing articles and variations.
It is therefore imperative that each item, each variation, has its own reference number.
It is possible to base the synchronization of articles/variations on another field (e.g., EAN 13 code).
To do this, you will need to modify the import.json file and assign the object_key: true field to the column in question.
Don't forget to also replace the reference_parent key which contains the parent_ref field which refers to the unique key of the parent article (for declined articles).
Below is an example of a connector using the EAN code as the primary key.
{
"product":{
"class":"\\Product",
"enabled":true,
"type":"local",
"fileExtension":"csv",
"data":{
"ean13":{
"index":0,
"object_key":true
},
"ean13_parent":{
"index":1,
"parent_ref":true
},
[...]
}
}
The type of synchronized weight (gross, net or customs) is left to the e-commerce merchant's discretion. However, the weight must always be synchronized in the same unit for all products ("g", "kg" etc.).
In PrestaShop, only the price excluding VAT is stored in the PrestaShop database.
Since version 1.6.0 of the PrestaShop module, it is possible to export prices including VAT from CEGID via the " Prices of products exported without tax from CEGID " parameter. The connector will then recalculate the price excluding VAT of the products and their variations based on the CEGID tax codes of the products or the default country of the PrestaShop store.
It should be noted that exporting product prices inclusive of VAT is strongly discouraged in order to minimize rounding discrepancies.
For dimensioned items, a column is provided to contain the unique key (by default the item code) of the parent product. The module creates attributes and attribute values based on the dimensions and Cegid dimension elements.
Each dimension (attribute group in PrestaShop) has its own column. To add a new column, you must add a new key to the import.json file.
Example of import settings for the Colour attribute group
"couleur":{
"index": i,
"is_attribute":true,// Required to declare a column as an attribute group
"public_name":"Colour"// Attribute group name, displayed in the front and back office
}
For items with specific characteristics, it is possible to add columns to the file import.json . To add a new feature, you must add the following code:
"matiere":{
"index": i,
"is_feature":true,// Required to declare a column as a feature
"public_name":"Matière"// Feature name, displayed in the front and back office
}
Since the version in 1.16.0 of the module, the connector allows you to associate items with manufacturers. To do this, you must add a column in the following format:
"manufacturer":{
"index": i,
"is_manufacturer":true// Required to declare a column as a manufacturer
}
Since the version in 1.6.0 of the module, the connector allows you to associate articles with a category tree. To do this, you must add one or more columns for each category depth according to the following format:
"category1":{
"index": i,
"is_category":true,// Required to declare a column as a category
"category_depth":0// Catégory depth
},
"category2":{
"index": j,
"is_category":true,
"category_depth":1
},
"category3":{
"index": k,
"is_category":true,
"category_depth":2
},
"category4":{
"index": l,
"is_category":true,
"category_depth":3
}
For multilingual stores, the connector allows you to associate columns with a specific language of a field.
For example, you can associate a column with the English label of the articles.
"nameEN":{
"index": i,
"lang":true,// Indicates that the field is multilingual
"iso":"EN",// Specifies the language in which the data should be entered
"ps_field":"name"// Specify which PrestaShop field the data should be synchronized as
}
The connector does not allow associating images with articles. For bulk associating images with your catalogue, we recommend using our image import module.
The connector does not allow the association of attached documents with articles. For bulk association of PDF documents with your catalog, we recommend using our PDF import module.
By default, this is how the connector imports CSV data related to the items.
JSON key
Data
Column index
Comment
reference
Article or variant reference
1
reference_parent
Parent article reference
2
If the article is a single article (without variations), leave this column empty.
If the article is a variation, enter the generic article reference in this column.
ean13
EAN13 code
3
name
Article title
4
Label in the store's default language
active
Active
5
Active or inactive item. If the item is inactive and does not exist in PrestaShop, it will be ignored.
wholesale_price
Purchase price
6
Purchase price excluding VAT of the item
price
Selling price
7
Public selling price (excluding or including VAT depending on settings) of the item or variation
tax_code
Tax rule
8
Cegid tax code applied to the item.
Important! Remember to configure the tax code associations.
weight
Weight
9
The type of synchronized weight (gross, net or customs) is left to the user's discretion.
description
Long description
10
stocks
Stock
11
Stock available for sale
available_date
Availability date
12
manufacturer
Manufacturer
13
Importing packages into PrestaShop
Title
Title
Configuration file
import.json
Stream name
pack
Type of exchange
CSV
Available since module version 3.0.0
This feed allows you to convert existing items into bundles in PrestaShop. The items must therefore have been previously imported via the item import feed.
Each line in the CSV file represents a component of a pack.
Since version 4.1.0 of the module, it is possible to specify the quantity of each component directly in the CSV file.
Simplified example:
PACK001;3701234560001;Pack été;false;PROD001;2
PACK001;3701234560001;Pack été;false;PROD002;5
In the example above,PACK001 will contain 2 units ofPROD001 and 5 units ofPROD002.PACK002 contains 2 units ofPROD008.
PACK002;3701234560003;Pack sport;false;PROD008;2
JSON key
Data
Column index
Mandatory ?
Comment
reference
Pack reference
1
Yes
Must correspond to the reference of an existing item in PrestaShop
ean13
EAN13 code
2
No
name
Pack title
3
Yes
farm
Farm
4
No
If the item is closed in Cegid, it will be deactivated in PrestaShop
component
Component reference
5
Yes
Component reference
component_quantity
Quantity of component
6
No
Quantity of component sold (if empty, the component will be sold as 1 unit)
Importing stores into PrestaShop
Title
Title
Configuration file
import.json
Stream name
store
Type of exchange
CSV
The establishments imported via this feed are integrated as shops in PrestaShop. This will therefore impact the list of shops displayed on the "Our Stores" page in the front office.
By default, this is how the connector imports CSV data related to the establishments.
JSON key
Data
Column index
Mandatory?
Comment
erp_code
Cegid code of the establishment
1
Yes
name
Name of the establishment
2
Yes
address1
Address 1
3
Yes
address2
Address 2
4
No
Used as the 2nd address line
postcode
Postal code
5
No
city
City
6
Yes
country
Country
7
Yes
Country code associated with the establishment
Important! Remember to configure the country associations.
state
State
8
No
ISO code of the state associated with the establishment
phone
Phone number
9
No
e-mail
E-mail address
10
No
latitude
Latitude
11
No
longitude
Longitude
12
No
active
Active
13
Yes
monday_hours
Monday opening hours
14
No
Tuesday_hours
Tuesday's schedule
15
No
Wednesday_hours
Wednesday Hours
16
No
Thursday_hours
Thursday schedule
17
No
friday_hours
Friday schedule
18
No
Saturday_hours
Saturday Hours
19
No
Sunday Hours
Sunday opening hours
20
No
Importing stock into PrestaShop
Title
Title
Configuration file
import.json
Stream name
stock
Type of exchange
CSV
By default, this is how the connector imports CSV data related to inventory.
JSON key
Data
Column index
Mandatory?
Comment
reference
Article or variant reference
1
Yes
quantity
Stock
2
Yes
Stock available for sale
Importing item discounts into PrestaShop
Title
Title
Configuration file
import.json
Stream name
specific price
Type of exchange
CSV
Since version 1.10.0 of the module, it is possible to define whether the prices of discounts imported from Cegid are in excluding or including tax.
The "Override existing specific prices? " parameter in the back office allows you to indicate whether you want to override a specific price created manually in PrestaShop if it conflicts with a Cegid discount (same customer, date range, etc.).
The "Recalculate discount percentage? " parameter in the back office allows you to export discounts where only the new item price is exported.
For example, an item A with a base price of €100 has its price reduced to €80. When this option is activated, the module will automatically calculate the discount percentage and display it in the PrestaShop front office (product lists and pages).
Since version 3.0.0 of the module, the discount flow supports association with customer groups . When a customer email address is entered and that customer belongs to a group with an associated ERP code, the discount will also be linked to the corresponding customer group.
By default, this is how the connector imports CSV data related to discounts.
JSON key
Data
Column index
Mandatory?
Comment
reference
Reference of the discounted item or variation
1
Yes
erp_code
Markdown pattern code
2
Yes
iso_code
ISO 3 code of the country concerned by the remittance
3
No
Leave blank to avoid applying the discount to a given country.
currency
ISO currency code
4
No
Leave blank to avoid applying the discount to a given currency.
group
ERP code of the client group benefiting from the discount
5
No
Leave blank to avoid applying the discount to a given group.
e-mail
Email of the customer benefiting from the discount
6
No
Leave blank to avoid applying the discount to a specific customer.
price
New price for the item or variation
7
No
reduction
Amount or percentage of discount
8
No
kind
Type of discount
9
Yes
For a percentage discount, enter one of the following values:
percent , pourcentage , pourcent or %
For a discount amount, enter one of the following values:
montant , € or $
reduction_tax
Discount excluding or including VAT
10
Yes
0 = Discount (excluding tax)
1 = Discount including VAT
Note: this setting only applies to discounts in amount
from_quantity
Discount to be applied starting from X quantity
11
No
from
Start date of the discount
12
No
to
End date of the submission
13
No
Import of store orders
Title
Title
Configuration file
import.json
Stream name
storeOrder
Type of exchange
CSV
No settings are available for this feed.
During module installation, a new order status is created: Store order. Any Cegid order imported into PrestaShop uses this order status.
Store orders imported into PrestaShop use the store address as the delivery address. In PrestaShop, the store address can be found in the "Shop settings" > "Contact" menu, under the "Contact details" section of the "Stores" tab.
Since version 4.0.0 of the module, the feed also handles in-store returns . An order is considered a return if the quantity of the lines is negative. During module installation, a Store return order status is automatically created for these returns.
In this data stream, each line corresponds to an item in an order. Therefore, for an order of 3 items, the CSV file must contain 3 separate lines.
Simplified example of a CSV file for a store order:
Order reference in PrestaShop. If empty, a random reference is automatically generated.
customer_erp_code
Customer code in Cegid
3
order_date
Order date
4
invoice_address_alias
Address alias
5
Billing address
invoice_address_address_1
Line 1 of the address
6
Billing address
invoice_address_address_2
Line 2 of the address
7
Billing address
invoice_address_postcode
Address postal code
8
Billing address
invoice_address_city
City of the address
9
Billing address
invoice_address_country
Country code of the address
10
Billing address
reference
Product reference
11
product_name
Product Name
12
qty
Quantity ordered
13
unit_price_tax_exclude
Unit price (excluding VAT)
14
unit_price_tax_incl
Unit price (including VAT)
15
discount_amount
Discount amount
16
total_tax_excluded
Total amount (excluding VAT)
17
total_tax_incl
Total amount (including VAT)
18
Importing order statuses into PrestaShop
Title
Title
Configuration file
import.json
Stream name
orderstatus
Type of exchange
Web service
No settings are available for this feed.
When importing order statuses, the module checks the following elements in order:
Is the order cancelled? If so, the PrestaShop order status changes to "cancelled".
Has the order been received by the customer? If so, the PrestaShop order status changes to "delivered".
Is the order being shipped? If so, the PrestaShop order status changes to "shipped".
Has the order been validated? If so, the order status changes to "Being prepared".
Check
Data analyzed from the web service
CEGID field name
PrestaShop status
Order canceled
CancelStatus
PIECE.GP_STATUTANNUL
Cancelled
Order received
FollowUpStatus = ReceivedByCustomer
MPIECEECO.MEJ_CDEECOMSUIVI
Livery
Shipping in progress
ShippingStatus = InProgress or Totally
MPIECEECO.MEJ_CDEECOMEXPED
Expedited
Validated
FollowUpStatus
MPIECEECO.MEJ_CDEECOMSUIVI
Preparation in progress
Import of return statuses
Title
Title
Configuration file
import.json
Stream name
orderReturnStatus
Type of exchange
Web service
No settings are available for this stream
The return status is conditional according to the value of the Cegid field MPIECEECO.MEJ_CDEECOMRETOUR :
Check
Donnée Data analyzed from the web service
PrestaShop status
Return accepted?
Return Accepted
Return confirmed
Return confirmed?
ReturnValidated
Return confirmed
Return refused?
ReturnRefused
Return refused
Returned?
Returned
Returned
Since version 4.0.0 of the module, the Cegid ReturnAccepted status is also supported and triggers the "Return validated" status in PrestaShop.
Exporting PrestaShop customers to Cegid
Title
Title
Configuration file
export.json
Stream name
customer
Type of exchange
Web service
This feed allows the export of leads from the PrestaShop store to Cegid.
A prospect is an account that has not yet placed an order and has never been integrated into Cegid.
By default, this feed is disabled in order to limit the number of requests between PrestaShop and Cegid.
It is recommended to leave this feed disabled except in the following cases:
- The number of PrestaShop customer accounts is relatively small (approximately 500 accounts)
- if you wish to integrate all customer accounts into Cegid even if they have not yet placed an order
Note that customers are automatically exported when orders are exported.
Since version 4.2.0 of the module, the following fields are also exported to Cegid when exporting clients:
PrestaShop field
Cegid field
Comment
VAT number
TIERS.T_NIF
(NIF/VAT number)
APE code
TIERS.T_APE
(Customer's commercial division)
SIRET number
TIERS.SIRET
Active customer
TIERS.T_FERME
A deactivated customer in PrestaShop will be closed in Cegid.
Main address
Customer address
Client primary address synchronization (Available since version 4.2.0)
Since version 4.2.0 of the module, the value of the field indicating whether the customer is a company ( TIERS.T_PARTICULIER ) depends on the presence of a Siret number at the PrestaShop customer level.
Exporting orders from PrestaShop to Cegid
Title
Title
Configuration file
export.json
Stream name
order
Type of exchange
Web service
When exporting orders, the customer record is updated in CEGID according to the following rules:
If the Cegid Client code transmitted by PrestaShop is entered, then the client is modified in Cegid according to the PrestaShop client record.
If the ERP Client code transmitted by PrestaShop is empty and if there is a client in CEGID with the same PrestaShop email address, then the client is modified.
If the ERP Client code is empty and there is no client in CEGID corresponding to the PrestaShop account email address, then the client is created in CEGID.
The ERP Client code is determined in relation to the WEB client identifier to which the parameterized prefix is applied.
The customer ID is always 10 characters long.
Examples:
Web Client Code = 1563; Prefix = "WEB" to ERP Client Code = WEB0000001563
Web Client Code = 12; Prefix = "W" to ERP Client Code = W0000000012
The "Internal Reference" field GP_REFINTERNE consists of a configurable prefix followed by the PrestaShop order number.
The "External Reference" field GP_REFEXTERNE is populated from the "Reference" field in PrestaShop. It is a unique reference for the order on the e-commerce site.
Since version 4.0.0 of the module, the following additional data is exported with the commands:
Transaction number ( PIEDECHE.GPE_CBNUMTRANSAC ): the payment transaction number is exported
Carrier ( MPIECEECO.MEJ_TRANSPORT ): the carrier code used is exported (requires carrier association)
Relay point code : if the customer has selected a relay point, the code is exported to the delivery address ( PIECEADRESSE.GPA_ADRESSE3 ). colissimo and unifiedco modules are supported.
Orders containing only virtual items (without physical carrier) are also supported.
Since version 4.0.0 of the module, the concepts of ERP Number & ERP stump are recorded in the database and can be consulted in the menu "Xy Connect – associations" > "Orders"
Since version 4.2.0 of the module, the value of the field indicating whether the document is invoiced excluding VAT ( PIECE.GP_FACTUREHT ) depends on whether the amount including VAT paid by the customer corresponds to the amount excluding VAT of the order or not.
Gift card management
Available since version 3.1.0 of the module
When the "(WebXY) Gift Cards" module is installed and an order includes a gift card payment, an additional payment is automatically generated when the order is exported. The payment code used for the gift card can be configured in the " Gift Cards " tab of the module's configuration page.
Cegid documents
Available since version 4.0.0 of the module
Cegid documents related to PrestaShop orders (Delivery Preparation, Customer Delivery, etc.) are displayed directly on the detail page of each order in the PrestaShop back office. This is only available if the PrestaShop order status export feed is enabled (disabled by default).
Add a caption...
The list of all documents related to PrestaShop orders is also available in a dedicated menu: “ Xy Connect – associations ” > “ Documents ”.
Add a caption...
Export of returns
Title
Title
Configuration file
export.json
Stream name
return
Type of exchange
Web service
Only returns with a status of "Pending confirmation" (ID #1) are exported to Cegid.
A document of type "Return ReturnNotice " is then created in Cegid.
This document is associated with the e-commerce establishment and the warehouse configured on the module's configuration page.
Since version 4.0.0 of the module, the following additional data is exported with the returns:
Establishment code : the establishment associated with the return (uses the establishment code for returns if configured, otherwise the main establishment code)
Payment method code : the payment method associated with the return
Original document : the original order is associated with the return in Cegid
Total amount of returned products : exported as payment
Export of order statuses
Title
Title
Configuration file
export.json
Stream name
orderstatus
Type of exchange
Web service
Available since version 4.0.0 of the module. This feed is disabled by default .
This feed allows the export of order status changes to Cegid. The following PrestaShop statuses trigger an export:
PrestaShop status
Configuration name
Created Cegid document
Preparation in progress
PS_OS_PREPARATION
Delivery preparation
Shipped
PS_OS_SHIPPING
Customer delivery
To activate this feed, change the enabled property to true in the export.json file. WebXY recommends leaving this feed disabled and letting Cegid manage order routing and import order status changes to PrestaShop via the order status import feed.
Synchronization logs
The synchronization logs page allows you to view the detailed history of all synchronizations performed between PrestaShop and Cegid. It is accessible from the back office, via the menu " Xy Connect " > " Logs ".
Dashboard
At the top of the page, three summary indicators provide a quick overview of the status of synchronizations over the log retention period (configurable via the " Keep logs for X days " setting in the Global tab).
These indicators are:
the warnings
blocking errors
successes
When a synchronization is in progress (detected if the last log is less than one minute old), an information banner " Synchronizing data in progress " is displayed before the list of synchronizations.
Add a caption...
List of synchronizations
Below the dashboard, a table lists all recorded synchronizations. Each row corresponds to an execution of an import or export flow and displays the following information:
Column
Description
Status icon
Colored visual indicator of the overall synchronization result: success (green), warning (orange), error (red) or information (blue)
ID
Unique log identifier
Synchronization type
Import or Export
Stream name
Name of the relevant flow (e.g., Products, Stocks, Orders, etc.)
Execution time
Synchronization time in seconds
HTTP code
HTTP code returned by the synchronization (e.g., 200 for success, 400 for client-side error, 500 for server error)
Sync date
Date and time of synchronization start
File
Download link to the archived source CSV file (if available). If the archive file no longer exists, a broken link icon is displayed.
The table is paginated with 20 entries per page. A navigation bar at the bottom of the table allows you to browse the pages.
Add a caption...
Log details
Clicking on a row in the table dynamically loads the synchronization details. These details are displayed in a sub-table that opens below the clicked row. Each detail row contains:
Severity icon : information (blue), success (green), warning (orange) or error (red)
Message : precise description of the operation performed (e.g., "Product XXX created", "Stock updated for variant YYY", "Error: reference not found")
Error code : technical error code, if applicable
Object class : the type of PrestaShop object concerned (Product, Combination, Customer, Order, etc.)
Object ID : PrestaShop identifier of the object in question
If the detail log contains more than 20 entries, a dedicated pagination allows navigation between detail pages.
Displaying log details for log #322
Search filters
The logs page offers two levels of filtering to quickly find the desired information.
Search by object
A search form at the top of the list allows you to filter the logs by PrestaShop object:
Product and variant search : search by reference, EAN13 code, product name, or PrestaShop ID. The search covers both parent products and variants.
Customer search : search by email address, name, surname or PrestaShop ID of the customer.
Order search : search by order reference or PrestaShop order ID.
When a search by object is performed, the list is replaced by a results table directly displaying the details of the corresponding logs (date, message, error code, object class, and object ID). A " Reset filters " button allows you to return to the full view.
Column filters
Filter fields are directly integrated into the header of the main table, allowing logs to be filtered according to the following criteria:
Filter
Field type
Description
ID
Text
Search by log ID
Synchronization type
Drop-down list
Filter by Import or Export
Stream name
Drop-down list
Filter by specific feed (Products, Stocks, Orders, etc.)
HTTP code
Text
Search by HTTP code (e.g., 200, 400, 500)
Sync date
Date selector
Filter logs for a specific date
The dropdown lists are automatically populated with the synchronization types and stream names actually present in the logs.
A search button and a reset button allow you to start the search and remove the applied filters respectively.
Active filter to display only the latest stock import logs
Automatic log purging
Old logs are automatically deleted each time the logs page loads and each time an import/export is performed. The retention period is defined by the " Keep logs for X days " setting in the Global tab of the module's configuration page.
When the data is deleted, the details of the associated logs are also deleted.