Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Import Strategy Configuration

Import Strategy Configuration

<importstrategy>

The importstrategy element contains one or more importer elements and one or more dependentelements.


...
<importer type="PRODUCT">
      <importstrategy>INSERT_OR_UPDATE</importstrategy>
      <dependentelements>
        <!-- FOR SINGLE AND MULTI-SKU PRODUCTS -->
        <dependentelement type="PRODUCT_ASSOCIATIONS">CLEAR_COLLECTION</dependentelement>
        <dependentelement type="PRODUCT_CATEGORY_ASSIGNMENTS">CLEAR_COLLECTION</dependentelement>
        <dependentelement type="PRODUCT_ATTRIBUTES">CLEAR_COLLECTION</dependentelement>
        <dependentelement type="PRODUCT_CATALOG_PRICES">RETAIN_COLLECTION</dependentelement>
        <dependentelement type="PRODUCT_PRICE_CURRENCIES">RETAIN_COLLECTION</dependentelement>
        <dependentelement type="PRODUCT_PRICE_TIERS">CLEAR_COLLECTION</dependentelement>
        <!-- FOR MULTI-SKU PRODUCTS ONLY. NOT TO BE EDITED WHEN IMPORTING SINGLE SKU PRODUCTS -->
        <dependentelement type="SKU_CATALOG_PRICES">RETAIN_COLLECTION</dependentelement>
        <dependentelement type="SKU_PRICE_CURRENCIES">RETAIN_COLLECTION</dependentelement>
        <dependentelement type="SKU_PRICE_TIERS">CLEAR_COLLECTION</dependentelement>
        <dependentelement type="PRODUCT_SKUS">RETAIN_COLLECTION</dependentelement>
        <dependentelement type="PRODUCT_SKU_PRICING">CLEAR_COLLECTION</dependentelement>
        <dependentelement type="SKU_ATTRIBUTES">CLEAR_COLLECTION</dependentelement>
      </dependentelements>
    </importer>
...

Each importer element contains information about what data to import. The type attribute specifies the type of object to import. Supported type attributes are:

  • CUSTOMERPROFILE_ATTRIBUTE
  • CMUSER
  • USER_ROLE
  • CUSTOMER
  • PROMOTION
  • COUPONSET
  • SYSTEMCONFIGURATION
  • PRICELISTDESCRIPTOR
  • GIFT_CERTIFICATE
  • SHIPPING_SERVICE_LEVEL
  • SHIPPING_REGION
  • SAVED_CONDITION
  • CM_IMPORT_JOB
  • CUSTOMER_CONSENT
  • DATA_POLICY

The importstrategy element within the importer element specifies how to handle conflicts during the import. The following values are supported:

Import strategy

Description

INSERT

Only new objects are imported. If an object with the same identifier exists in the target system, the object is not imported.

UPDATE

Only updated objects are imported. If an imported object does not exist in the target system, the object is not imported.

INSERT_OR_UPDATE

Both new and updated objects are imported. If no import strategy is specified, the default is INSERT_OR_UPDATE.

<dependentelements>

The optional dependentelements element lets you configure conflict resolution for dependencies. The dependentelements element can contain one or more dependentelement elements. The dependentelement element's type attribute specifies the type of dependency. Supported type attributes are:

  • PRODUCT_CATEGORY_ASSIGNMENTS
  • PRODUCT_ATTRIBUTES
  • PRODUCT_SKUS
  • SKU_ATTRIBUTES
  • PRODUCT_SKU_PRICING
  • PRODUCT_CATALOG_PRICES
  • PRODUCT_PRICE_CURRENCIES
  • PRODUCT_PRICE_TIERS
  • SKU_CATALOG_PRICES
  • SKU_PRICE_CURRENCIES
  • SKU_PRICE_TIERS
  • SETTING_VALUES
  • SETTING_METADATA
  • BASE_AMOUNTS

Each dependentelement contains either CLEAR_COLLECTION or RETAIN_COLLECTION, to indicate how dependencies of the specified type are handled in the event of a conflict during import.

Note: The Retain collection option is not available for Product Bundles. Product Bundles must use Clear collection to ensure that the ordering of bundle constituents is maintained.

Related Topics