Configure a TargetServer for Objects Synchronization - Sintraconsulting/pimcore-product-sync-plugin GitHub Wiki

Configure a TargetServer for Objects Synchronization

The SintraPimcoreBundle was implemented in order to create a synchronization flow from Pimcore to E-Commerce platforms such as Magento 2 and Shopify.

The first pass needed to build up this synchronization flow is the creation of an object of the TargetServer class provided by SintraPimcoreBundle.

Let's see how to properly create such this object.

##Server General Data Provide general information of the server. In particular, you need to set the following fields:

  • enabled: Tells if the server is enabled (i.e. if objects have to be synchronized in that server).

  • Name: Name of the server. You can choose whatever you want.

  • Server Type: Can be choose from "Magento 2" and "Shopify".

  • Server API URL: The URL of you server installation.

  • Valid Languages (optional): One or more languages to be choose from the languages that you have defined in Pimcore. Will be used for field checking and value retrieval during the synchronization (See below).

##Server API Data Store information needed to invoke the API calls that perform object CRUD operations, such as API key. In the "Server Info" section of the object you will be able to add one (and only one) ObjectBrick defined for "Magento 2" or "Shopify".

##Fields to Export You can choose one or more classes to synchronize from Pimcore to the server. For each of them, you need to set:

  • Class: The class that you want to synchronize, choosing from the ones that you have defined in Pimcore.

  • Fields to Export: A multi-selection list of Pimcore object's fields that you want to export on the server. Each time that an object is saved, all selected fields are checked: if at least one of them has a different value compared to the previous one, the object will be marked as "Not Synchronized" for this specific server. For localized fields, this check is repeated for each of the "Valid Languages" defined before. Check the Object Synchronization Flow for more details.

##Export Map In order to create or update an object on the server, you need to properly create the API call body (typically as a json string) to perform the operation. The SintraPimcoreBundle allow you to setup this directly by Pimcore interface without any hard-coded values or any configuration files. For each field that you need to export on the server, you need to set:

  • Required: Tells if the field is required for the server. You have to set a field as required for all API mandatory fields and for other fields that you need to be filled before object synchronization. Each time that an object is saved, if all required fields are not empty the object will be marked as "Complete" for the server. Check the Object Synchronization Flow for more details.

  • Class: The Pimcore class in which the field is present

  • Object Field: The specific field

  • Field Type: Can be choose from "Standard" and "Reference". If the Pimcore field store the relation with another object (of the same or different class) you may want to get one specific field of the related object (i.e. the name of the related Category object) and so you need to set this field as "Reference". For all other kinds of fields, just set as Standard.

  • Related Field: With reference to the previous example, if the field type is "Reference" you need to define the related object field (i.e. name). Keep blank for "Standard" fields.

  • Server Field: the corresponding field name in the server. This is used to create the API body. In case that that API body has nested levels, you must use the "." (dot) character as levels separator. For example, In Magento 2 the product description is considered a custom attribute in the API call; so, the server field name must be "custom_attributes.description"

⚠️ **GitHub.com Fallback** ⚠️