Product synchronization for Magento 2
Field mapping
The core of the product synchronization is the map defined at System->NetSuite->Settings->Product synchronization->Field Mapping . This mapping defines the link between Magento attributes and Inventory Items custom/standard fields. Each mapping line contains 3 elements:
- NetSuite field name. Either the custom field id from NetSuite or a standard field name, as defined in the NetSuite SuiteTalk documentation
- NetSuite settings. Various options explained in the table below.
- Magento . A drop-down where you can pick up a Magento attribute. If the Magento attribute is a dropdown or multi-select, then the options will be created automatically. I.e. if you import colors, you only need to create the "color" attribute in Magento and map it, no need to populate it with all possible colors before hand
| Setting | Description | Extra parameters and description |
|---|---|---|
| Standard Field | A InventoryItem standard field. Please refer to the SuiteTalk documentation for a full list | none |
| Custom Field - simple | A custom field defined in NetSuite that does not represent a list | none |
| Custom Field - list | A custom field defined in NetSuite that represents a list | NetSuite list id - the internal NetSuite id for the list |
| Custom Field - checkbox | A custom record defined in NetSuite that has the checkbox type | Value - define the value that is to be imported in Magento when the checkbox is checked in NetSuite, i.e. "1" or "y" |
| Constant Magento Value | A constant value that should be set to all Magento products during import. When selected the NetSuite field name field is hidden | Value - this is a text field to define the value that will be set in every Magento product. |
You don't need to map all attributes. If you want to handle an attribute directly in Magento, then don't create any mapping for it so it will never be overwritten by NetSuite data. However, you do have to map all the attributes that are used in the creation of configurable products.
Not supported mappings
In general, the connector can import mappings to each standard or custom product attribute except media. Here are some examples of mappings that cannot be defined:
- media images (basic logic for Image management was added recently, it requires some form of customization based on NS & Magento setup)
- categories
- related/upsell/cross-sell products (works out of a CSV field in NetSuite)
One to many mappings
If you want to map multiple NetSuite fields into a single Magento attribute, you can add all the NetSuite fields in the "Netsuite field name" map item, comma delimited. By default the values will be merged by adding space between them, but a custom event ("netsuite_product_fields_merge") is also thrown, allowing you to write code to do a custom merge.
Product type mapping
| NetSuite Type | Magento type |
|---|---|
| Matrix Item | Configurable product |
| Matrix Child Item | Simple product |
| Kit Item | Bundle product |
| Assembly Item | Bundle product |
| Inventory Item | Simple product |
Complete list of imported fields
| Magento field | NetSuite field | Applies to | Notes |
|---|---|---|---|
| type_id | - | All | The type of the product, according to the product type mapping above |
| Multiple | Multiple | All | All the fields defined at System->NetSuite->Settings->Product synchronization->Field Mapping . The following fields must be mapped at a minimum:
|
| Visibility | As defined | Only new products | Applies to new products only according to the settings at System->NetSuite->Settings->Product synchronization. |
| Status | As defined | Only new products | Applies to new products only according to the settings at System->NetSuite->Settings->Product synchronization. |
| Tax class | As defined | Only new products | Applies to new products only according to the settings at System->NetSuite->Settings->Product synchronization. |
| Website IDs | As defined | Only new products | Applies to new products only according to the settings at System->NetSuite->Settings->Product synchronization. |
| Store IDs | As defined | Only new products | Applies to new products only according to the settings at System->NetSuite->Settings->Product synchronization. |
| Attribute Set ID | As defined | Only new products | Applies to new products only according to the settings at System->NetSuite->Settings->Product synchronization. |
| Imported tier price customer group | As defined | Only new products | The default customer group to be used for tiers |
| Imported tier price website | As defined | Only new products | The default website id to be used for tiers (All websites can also be specified) |
| Stock info | As defined | All | Simple products: Quantity grabbed from the "Quantity field name" connector config and from the "Location Internal Id" location Configurable products: always in stock (simples will handle the actual stock) Bundles: always in stock (simples will handle the actual stock) |
| Price | As defined | All | Grabbed from the defined price level inside the connector config. If quantity-based prices are defined, then they will be imported as tiers |
| Special Price | As defined | Simple | Grabbed from defined price level inside the connector config. |
| Configurable attributes | As defined | Configurable | Matrix items will import the matrix options as configurable attributes. All the matrix options must also be present in the mapping at System->NetSuite->Settings->Product synchronization->Field Mapping |
| Bundle price type | Always set to "dynamic" | Bundles | |
| Price view | Always set to 1 (Display "As low as") |
Import / reimport scripts
Importing all products
A Magento command is exposed as netsuite:utils:importproducts that allows you to import all products
| Param name | Possible values | Description |
|---|---|---|
| type | Either "all" or "add-only". | add-only only adds new products, while all will also update existing ones |
| wipe-existing | none, just add the param | Start by deleting all the products imported from NetSuite |
| resume-at | integer | Products are grabbed in pages. If you want to resume an import at a specific page, add the page number here |
| product-type | simple, configurable, bundle, assembly, all | allows to import only a specific product type |
Example:
bin/magento netsuite:utils:importproducts --type all --product-type simple --resume-at 2
The above will import simple products, starting with page 2. It will also update existing products.
Import a single product
See the Magento shell command netsuite:utils:importsingleproduct to force the import of a specific product
| Param name | Possible values | Description |
|---|---|---|
| id | netsuite internal id | The netsuite internal id of the product to be imported |
| delete-existing | none | whether the product should be deleted first if it exists in Magento |
Matrix product imports
In case you are using the NetSuite CSV import and also using matrix products, an additional step is needed after the import. You need to run a mass update on all (or only newly imported matrix items). The connector makes use of suite script + user events to populate some relational fields:
The above is usually present under the "Magento" tab on the item view screen.
Please get in touch with your NetSuite implementor or Rocket Web to create this mass update for you if needed.
Related products and Upsells
To enabled importing of the related products and upsell products you need to configure the following fields:
| Param name | Description |
|---|---|
Related Products Field Name | This field should contain comma-separated internal IDs of the related products |
Upsells Field Name | This field should contain comma-separated internal IDs of the upsells |
After these are configured - all related and upsell products will be imported automatically when products will be updated in the NetSuite. Full reimport is needed to update all the products.

No comments to display
No comments to display