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
| Setting | Description | Extra parameters and description |
|---|---|---|
| Standard Field | A InventoryItem standard field. Please refer to the SuiteTalk documentation for a full list | none |
| Record Field | A 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 - 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" |
| Custom Field - custom record | A custom field defined in NetSuite that represents a custom record | NetSuite 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 Type | Magento type |
|---|---|
| InvetoryItem matrix | Configurable product |
| InventoryItem matrix child | Simple product |
| KitItem | Bundle product |
| AssemblyItem | Bundle 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 name | Possible values | Description |
|---|---|---|
| all | none, just add as param | Import all products, i.e. will rewrite exiting products |
| add-only | none, just add as param | The counterpart of "all". If mode is add-only, existing products will not be updated |
| wipe-existing | none, just add the param | Start by deleting all the products imported from NetSuite |
| from-date | YYYY-MM-DD date | Import only the products that are modified after the specified date |
| verbose | none, just add param | Display progress information |
| resume-at | integer | Products are grabbed in pages. If you want to resume an import at a specific page, add the page number here |
| type | simple, configurable, bundle, assembly, all | allows 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 name | Possible values | Description |
|---|---|---|
| id | netsuite internal id | The netsuite internal id |
| delete-existing | none | whether the product should be deleted first if it exists in Magento |
No comments to display
No comments to display