Channel Advisor Product Import

Overview

Core dna has the ability to import products from Channel Advisor on a nightly basis. This import is controlled by a switch in the products configuration. A optional config JSON file handles the mapping of all fields From Channel Advisor to Core dna, if you do not provide this then the default engine config will be used. Logs for each run are saved in the reports section.

Note Core dna fetches products using the last updated flag in Channel Advisor from our last run time. This run time variable is saved at the start of each run before processing any records.

Functionality

This import script will sync existing products and variants from Channel Addvisor to Core dna. It does this by filtering on the 'last updated date' in CA's API, and then looking up the product using its code or name. The code or name check has to be a match for what is given. Typically it will find products using the code, name is just a fall back.

This importer will not create new products, only update existing ones. Custom properties are not supported currently.

When working with pricing records, if none exist it will create a new one. If records already exist, it will fetch the first record and then update that.

Setup

Get Channel Advisor Developer Credentials.

In order to connect to Channel Advisor we need the developer credentials from Channel Advisor, follow the steps detailed below:
(This step only needs to be taken if this is the first time connecting to CA for this site)

https://developer.channeladvisor.com/authorization/developer-console-token

Once you have set this up, In Core dna navigate to Transactions → Inventory and then click Configure → Inventory Plugins.

Select Channel Advisor from the Provider drop down and enter the required fields. Then click on the Channel Advisor logo and you will be taken to their OAuth site to grant permission. Once you accept you will be returned to Core dna and the Channel Advisor Oauth configuration is now complete.

Config File

Core dna allows each site to load a custom JSON config file to easily control the mapping of each field. If no config is provided then the default engine config will be used. The file must be located here:

sitedir/modules/prodcatalogue/templates/ca/products.json

and the contents must be formatted as follows

orders.json
{
 "product": {
 "name""Title",
 "description""Description",
 "price""RetailPrice",
 "qty""TotalQuantity"
 },
 "variant": {
 "text""Title",
 "price""",
 "description""'hello there'",
 "stock""TotalQuantity"
 },
 "variant_pricing": {
 "value""RetailPrice",
 "sign""'+'",
 "modifier""'$'",
 "publish""'on'"
 },
 "variant_fields": {
 "note""This is not a field. Use the below list as a guide for all available fields. If no value is returned from CA blank will be saved.",
 "product_id""",
 "text""",
 "stock""",
 "weight""",
 "minqty""",
 "qty_limit_per_order""",
 "description""",
 "product_code""",
 "variant_code""",
 "stock_id""",
 "width""",
 "height""",
 "length""",
 "publish""",
 "index""",
 "quantity_based""",
 "package_width""",
 "package_length""",
 "package_depth""",
 "package_weight""",
 "package_fragile""",
 "mpn""",
 "gtin"""
 },
 "product_fields": {
 "note""This is not a field. Use the below list as a guide for all available fields. If no value is returned from CA blank will be saved.",
 "name""",
 "merchant_id""",
 "url_name""",
 "code""",
 "short_desc""",
 "description""",
 "tags""",
 "weight""",
 "qty""",
 "brand""",
 "supplier""",
 "taxcode""",
 "taxclass""",
 "price""",
 "special_price""",
 "showtype""",
 "image1""",
 "image2""",
 "image3""",
 "image4""",
 "image5""",
 "minorder""",
 "maxorder""",
 "dimensions""",
 "publish""",
 "status""",
 "date_added""",
 "date_modified""",
 "report""",
 "inheritaccess""",
 "defaultaccess""",
 "start_date""",
 "end_date""",
 "permanent""",
 "old_id""",
 "lat""",
 "lng""",
 "type""",
 "expiry_type""",
 "expiry_date""",
 "expiry_period""",
 "cost_price""",
 "rr_price""",
 "pick_up_only""",
 "handling_fee""",
 "display""",
 "layout""",
 "restock_date""",
 "fragile""",
 "packable""",
 "wrappable""",
 "length""",
 "width""",
 "depth""",
 "instore_pickup""",
 "mpn""",
 "gtin""",
 "lifetime_limit""",
 "availability_date""",
 "shipping_lead_time""",
 "shipping_class_id""",
 "warehouse_id"""
 },
 "variants_pricingc": {
 "--note--""This is not a field. Use the below list as a guide for all available fields. If no value is returned from CA blank will be saved.",
 "text""",
 "weight""",
 "minqty""",
 "description""",
 "plugins""",
 "sign""",
 "value""",
 "modifier""",
 "stock_id""",
 "width""",
 "height""",
 "length""",
 "publish""",
 "defaultaccess""",
 "index""",
 "quantity_based""",
 "variant_id""",
 "cost_price""",
 "rr_price""",
 "special_value""",
 "expiry"""
 }
}

On the left is the Core dna key, on the right is the Channel Advisor key. You should modify the Channel Advisor keys. You can see the Channel Advisor data returned in the report logs, this will help you see what data is coming in and how to map accordingly.

The config also allows some extra functionality:

Enable Product Import

 Navigate to Transaction → Catalogues → Manage Configuration. Near the bottom of this screen you will see a section called Channel Advisor Product Import. Enable the switch the products will be imported on next run.

Reporting

Under Cog Wheel → Reporting, you will see a log file "products_channel_advisor_" this will show the output for that import session. This logging area show a lot of information so please check this for any issues.