Shopify provides the ability to create custom fields. To synchronize custom fields between Shopify and Odoo, please read the article below.
1. Find the technical name of the metafield
In your Shopify Admin panel go to Settings → Metafields and metaobjects. In the list of store parts, choose Products.
In the list of all product definitions, you can create a new one or choose the existed one.
Custom fields for a product in Shopify are displayed as follows
That is the technical name, how the metafield is represented in the Shopify API.
2. Create metafield mapping. Part 1
For example, we want to add synchronization capability for vendor_id
Go to Configuration → Field Definitions and create a new definition.
Fill in the form with the relative information.
-
Give a Field Name for a new Field definition (i.e. Vendor mapping)
-
Choose the Connector Type (Shopify)
-
Select the Odoo Model for the mapping (Product Template or Product Variant)
-
Set a Field for the mapping (i.e. seller_ids)
-
Enter the technical name of the metafield in API Field Name.
-
Activate the checkbox Metafield
-
Choose the Metafield Type (i.e. Single Line Text Field)
-
(Advanced) Sometimes the scripting for import/export is required
Our connector supports the following Metafield types:
-
Boolean
-
Color
-
Date
-
Date Time
-
Dimension
-
JSON
-
List Collection Reference
-
List Color
-
List Date
-
List Date Time
-
List Dimension
-
List File Reference
-
List Metaobject Reference
-
List Mixed Reference
-
List Number Integer
-
List Number Decimal
-
List Page Reference
-
List Product Reference
-
List Rating
-
List Single Line Text Field
-
List URL
-
List Variant Reference
-
List Volume
-
List Weight
-
Money
-
Multi Line Text Field
-
Number Decimal
-
Number Integer
-
Rating
-
Rich Text Field
-
Single Line Text Field
-
URL
-
Volume
-
Weight
2.1 (Optional) Validate the mapping
When the definition form is filled, it gives you the possibility to validate the mapping. You will see what mappings comes from the Shopify, or what will be sent during the export.
Click Test Mapping
In a new appeared window choose the integration, that you want to use for testing and what operation you are interested in: import or export.
Choose a product for testing and press Run Import Test (or Run Export Test)
If the appeared value is the same that you have on the Shopify side, you are in the right way.
3. Create metafield mapping. Part 2
The mapping is created, now it’s time to assign that mapping to your integration.
Go to Configuration → Field Synchronization
Add a new line of Field Synchronization for your integration.
In the appeared line choose the specific definition that you just created.
When you choose definition, other fields will be automatically completed.
The 2nd and the 3rd switchers will show, in what direction the connector will synchronize the configured metafield mapping.