Skip to main content

Product synchronization

Field mapping

 

The core of the product synchronization is the map defined at 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

 

SettingDescriptionExtra parameters and description
Standard FieldA InventoryItem standard field. Please refer to the SuiteTalk documentation for a full listnone
Record FieldA standard field that points to a standard record

Search class name: For standard records, SuiteTalk defines search classes, i.e. SiteCategorySearch. You need to find the class name in the documentation and add it here.

Name field: the standard record searches return objects of specific types, i.e. SiteCategory. They are documented in SuiteTalk reference. The value you put in this field must be the object property that is a good textual representation for import, i.e. name

Custom Field - simple

A custom field defined in NetSuite that does not represent a list

none
Custom Field - listA custom field defined in NetSuite that represents a listNetSuite list id - the internal NetSuite id for the list
Custom Field - checkboxA custom record defined in NetSuite that has the checkbox typeValue - define the value that is to be imported in Magento when the checkbox is checked in NetSuite, i.e. "1" or "y"
Custom Field - custom recordA custom field defined in NetSuite that represents a custom recordNetSuite custom record id - the internal NetSuite id for the custom record

 

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.

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 TypeMagento type
InvetoryItem matrixConfigurable product
InventoryItem matrix childSimple product
KitItemBundle product
AssemblyItemBundle product

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
  • categories
  • related/upsell/cross-sell products

 

Import / reimport scripts

Importing all products

Script at MAGE_ROOT/shell/netsuite/importAllProducts.php

Param namePossible valuesDescription
allnone, just add as paramImport all products, i.e. will rewrite exiting products
add-onlynone, just add as paramThe counterpart of "all". If mode is add-only, existing products will not be updated
wipe-existingnone, just add the paramStart by deleting all the products imported from NetSuite
from-dateYYYY-MM-DD dateImport only the products that are modified after the specified date
verbosenone, just add paramDisplay progress information
resume-atintegerProducts are grabbed in pages. If you want to resume an import at a specific page, add the page number here
typesimple, configurable, bundle, assembly, allallows to import only a specific product type

Example: 

nohup php importAllProducts.php --all --verbose --type simple --resume-at 2 &> /tmp/netsuite_log &

The above will import simple products, displaying output and starting with page 2. It will also update existing products. The script will be running detached from the current shell.

Import a single product

Script at MAGE_ROOT/shell/netsuite/importSingleProduct.php

Param namePossible valuesDescription
idnetsuite internal idThe netsuite internal id
delete-existingnonewhether the product should be deleted first if it exists in Magento