You can import an entire catalog at once; the import operation includes the catalog and any categories and products within the catalog. Export works similarly; you export the entire catalog at once.
Catalog import/export is designed so that:
Select site > Merchant Tools > Products and Catalogs > Import & Export
You can import a catalog from a CSV or XML file type. A CSV file can only be uploaded in MERGE mode and you have to specify which catalog you're uploading before continuing the import process.
The catalog import is implemented as a two-pass import.
The import process allows the category and product elements to appear in any order in the feed. During import, you don’t have exposure to the two passes. The default transaction mode commits changes after each object import. If the import is aborted between the first and second pass, the created or updated object can be left behind and relationships are not created for the object. To eliminate leaving objects behind, include all entities corresponding to a catalog in a single XML file.
New products imported in MERGE and REPLACE modes default to offline status if this status isn't specified in the import file.
The import schema catalog.xsd
requires that a
<value-definition> element must declare a child <value> element. The specified value
must be nonempty and it must not contain leading or trailing whitespace.
You can export data on selected products from Business Manager or through a custom pipeline. During catalog export, Salesforce B2C Commerce automatically trims leading and trailing whitespace and removes any previously saved newline characters in a product image path. You can export a catalog as an XML or a CSV.
Business Manager catalog
export mode Export Specific Products
only contains the list of selected
products and the category assignments for those products. Select
site > Merchant Tools > Products and Catalogs > Import
& Export > Catalog Export > catalog > product(s). You can use the
standard product search functionality or the beta search functionality as described in Simple Products Search.
Page meta tag rules and definitions are now imported and exported within a separate 'Page Meta Tags' section. See Page Meta Tags.
Only assignments are imported and exported within Catalog, Library and Site ImPex.
ImportCatalog
Imports the catalog data specified by ImportFile into the system in the specified mode. This has an import configuration that lets you delete the catalog before import. You can use this as a high-performance way to empty a catalog, specifically if the objects in the catalog are unknown. You can also delete custom attributes before import when using the UPDATE or MERGE mode. For more information, see Removing Outdated Objects.
Custom product attribute definitions can only be imported using the
pipelet ImportCatalog. It isn't possible to import product object custom attribute definitions
using Business Manager catalog import. The import of custom product attribute definitions must
be explicitly enabled. Do this by setting the ImportCatalog pipelet ImportConfiguration
parameter to ImportAttributeDefinitions = true.
If this parameter isn't
provided in the ImportConfiguration or if it's set to false,
product attribute
definitions are not imported.
If product attribute definitions are provided in the
catalog import file, but the ImportAttributeDefinitions = false
or not provided
or the file is imported in Business Manager, then a data error is logged. In this case, the
product-attribute-definitions element is ignored during import for the UPDATE, MERGE, and
REPLACE import modes.
ExportCatalog
When theExportCatalog
pipelet parameter
ExportCategoryAssignments=True,
and a Products
iterator is
specified, only the category assignments for the list of exported products or categories
assignments are contained in the export file. When the Products
iterator isn't
specified, all category assignments are exported.Granularity: passed categories, products of passed categories, category assignments of passed categories, all recommendations in catalog, all shared product options in catalog).
This section describes the elements in the catalog.xsd and considerations when creating values for them.
Element: Category
The following are some element-specific details you need to consider when importing a category element.
Attributes: online-from and online-to
Some situations require that the online-from and online-to category attributes values be reset during a catalog import process. For example, XML validation fails if these element are submitted in XML with an empty value, for example, <online-from/>.You can reset the online-from and online-to category attributes during a catalog import process.
To rest these attributes values during a catalog import process, the import file must conform to the following XML format example:
<category category-id="RESET_ME">
<!-- reset default online-from value -->
<online-from xsi:nil="true" />
<!-- reset default online-to value -->
<online-to xsi:nil="true" /> </category>
You must also add the following to your catalog import file:
xsi:noNamespaceSchemaLocation="catalog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
For example:
<catalog xmlns="http://www.demandware.com/xml/impex/catalog/2006-10-31"
xsi:noNamespaceSchemaLocation="catalog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" catalog-id="catalog">
When using UPDATE Mode:
Understanding the behavior of UPDATE mode is important for customers who can produce catalog delta files to update their catalogs.
Subelement | Comments |
---|---|
display-name | If element omitted: attribute not altered |
description | If element omitted: attribute not altered |
online-flag |
If element omitted during create: defaults to false If element omitted during update: attribute not altered |
parent | If element omitted: DATAWARNING in log, defaults to "root" |
position | If element omitted: attribute not altered |
thumbnail | If element omitted: attribute not altered |
image | If element omitted: attribute not altered |
template | If element omitted: attribute not altered |
sitemap-included-flag | If element omitted: attribute not altered |
sitemap-changefrequency | If element omitted: attribute not altered |
sitemap-priority | If element omitted: attribute not altered |
page-attributes |
If element omitted: attributes not altered Element provided: MERGE semantic for each attribute and locale |
custom-attributes |
If element omitted: attributes not altered Element provided: MERGE semantic for each attribute and locale |
category-links |
If element omitted: category links not altered Element provided: REPLACE semantic on outgoing category links Order of appearance of category-link elements defines sort order |
attribute-groups |
If element omitted: groups not altered Element provided: REPLACE semantic Order of appearance of attribute-groups defines sort order Order of appearance of attributes defines sort order |
refinement-definitions |
If element omitted: refinements not altered Element provided: REPLACE semantic Order of appearance of refinement-definition elements defines sort order |
Element: Product
The following are some element-specific details you need to consider when importing the product element.
Resetting product Attributes
In some cases, you might want to remove values for product attributes during import in merge mode.
<product product-id="RESET_ME">
<!-- reset default online-from value -->
<online-to xsi:nil="true" />
<!-- reset default search-placement value -->
<search-placement xsi:nil="true" />
<!-- reset site-specific search-placement value -->
<search-placement site-id="YourSite" xsi:nil="true" />
</product>
xsi:noNamespaceSchemaLocation="catalog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
to the root element of your import file, so that it looks like the
following:<catalog xmlns="http://www.demandware.com/xml/impex/catalog/2006-10-31" xsi:noNamespaceSchemaLocation="catalog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" catalog-id="catalog">
Special processing for Subelements
Some product subelements have a special semantic or set of defaults, if not provided in the feed. The following table provides details.
Sub-element | Comments |
---|---|
ean | If element omitted: attribute not altered |
upc | If element omitted: attribute not altered |
unit |
If element omitted during create: defaults to empty string If element omitted during update: attribute not altered |
min-order-quantity |
If element omitted during create: defaults to 1 If element omitted during update: attribute not altered |
step-quantity |
If element omitted during create: defaults to 1 If element omitted during update: attribute not altered |
display-name | If element omitted: attribute not altered |
short-description | If element omitted: attribute not altered |
long-description | If element omitted: attribute not altered |
online-flag |
If element omitted during create: defaults to true If element omitted during update: attribute not altered |
online-from | If element omitted: attribute not altered |
online-to | If element omitted: attribute not altered |
available-flag |
If element omitted during create: defaults to true If element omitted during update: attribute not altered |
searchable-flag |
If element omitted during create: defaults to true If element omitted during update: attribute not altered |
image | If element omitted: attribute not altered |
thumbnail | If element omitted: attribute not altered |
template | If element omitted: attribute not altered |
tax-class-id | If element omitted: attribute not altered |
brand | If element omitted: attribute not altered |
manufacturer-name | If element omitted: attribute not altered |
manufacturer-sku | If element omitted: attribute not altered |
search-placement | If element omitted: attribute not altered |
search-rank | If element omitted: attribute not altered |
sitemap-included-flag | If element omitted: attribute not altered |
sitemap-changefrequency | If element omitted: attribute not altered |
sitemap-priority | If element omitted: attribute not altered |
page-attributes |
If element omitted: attributes not altered Element provided: MERGE semantic for each attribute and locale |
custom-attributes |
If element omitted: attributes not altered Element provided: MERGE semantic for each attribute and locale The values for the custom attribute don't merge. Merge creates the object if it doesn't exist and then modifies an existing object. Object attributes that are not provided in the feed are left untouched. When a custom-attribute value is in the XML file, the product gains that value but the other values that were selected before are no longer selected. The Import merge mode imports the attributes and not the value itself. Sometimes for values (for example, variation attribute values) a specific merge-mode is available; but this isn't the case for the custom attributes to which you are referencing. |
bundled-products |
If element omitted: relationships not altered Element provided: REPLACE semantic Order of appearance of bundled-product elements defines sort order. |
product-set-products |
If element omitted: relationships not altered Element provided: REPLACE semantic Order of appearance of product-set-product elements defines sort order |
options |
If element omitted: options not altered Element provided: REPLACE semantic on all private and shared options (delete/create private options, unbind/bind shared options) Order of appearance of option and shared-option elements defines sort order |
variations |
Element variations omitted: attributes and relationships not altered Element attributes omitted: attributes not altered Order of appearance of attribute elements defines sort order Element variants omitted: relationships not altered merge-mode attribute determines whether variations are added, removed, or replaced, regardless of MERGE semantic. if merge-mode attribute isn't provided, the REPLACE semantic is used by default. This is the legacy behavior for the element. |
product-links |
If element omitted: product links not altered Element provided: REPLACE semantic on outgoing product links Order of appearance of product-link elements defines sort order |
classification-category | If element omitted: relationship not altered |
Site-Specific Attributes
The
<product>
import/export elements
,
<online-flag>
,
<online-from>
,
<online-to>
,
<searchable-flag>
,
<search-rank>
,
<search-placement>
,
<sitemap-included-flag>
,
<sitemap-priority>
, and
<sitemap-changefrequency>
elements support an optional
site-id that indicates the attribute value is site-specific by specifying a
human-readable site ID, for example:<custom-attribute>
<online-flag site-id="MySiteEurope">false</online-flag>
Element: Images
Catalog import supports a
merge-mode
attribute for the <images> section. This attribute has two
possible values:
merge
: the default.replace
: use if you intend to erase all stored image information for a
product and then reimport. Use this, for example, if you changed the variation attributes
that a base product uses to vary its images by.merge-mode
attribute is supported,
it only makes sense to use it when the overall import mode is UPDATE or MERGE.Element: Category-Assignment
The system preserves product-category assignments as part of catalog.xsd during import, allowing you to import categories with predefined product assignments in one step. This is especially helpful in the case where a single (classification) catalog is used in conjunction with multiple, site-specific (navigation) catalogs.
The,
variation-configuration
, element and the complex type,
VariationConfiguration
, allow the configuration of slicing for
variation products at the category level.
When you assign product position values for a
category in Business Manager, each product’s position value is represented as a sequential
number. When products are imported/exported, their position
element of
category-assignment
is assigned a value of auto
. To resolve
the common value and determine product position, each product’s actual position is determined by
the order in which it appears in the file.
For example, in Business Manager Product A is
assigned as position 1 and Product B is assigned as position 2 for a category. During import,
the value of the position
elements for both products is set to
auto
. Because Product A is first in the file, Product A is listed first and
Product B is listed second.
Element: Product-Attribute-Definitions
The product-attribute-definitions element is intended to
support attribute definitions for the product object via a feed from a third-party or backend
system. It isn't intended to allow the general import of attribute meta data via import. Product
attribute definition metadata isn't supported for export. If the
product-attribute-definitions
element includes definitions for system
attributes, the import file is invalid.
Attribute definitions can only be imported via the ImportCatalog pipelet and can't be imported via Business Manager import. Product attributes created by catalog import have the following default values:
false
false
true
If the product-attribute-definitions
element isn't defined
in the import file, no existing product attribute definitions are modified during
import.
The element is processed identically for the MERGE, REPLACE, and UPDATE modes. If
the product-attribute-definitions
element is defined in the import file, the
import checks whether the attribute definition already exists in the database and does the
following:
true
in the B2C Commerce database.false
in the B2C Commerce database are ignored during import and the system
logs a data error.externally-defined-flag
set to true,
it's removed. This also removes any configured values for the attribute from the B2C
Commerce database.B2C Commerce removes any externally defined attributes not present in the import feed because backend systems are often unable to provide information about obsolete information. The automatic removal of obsolete attributes prevents the accumulation of large numbers of obsolete attributes in the database.
For the import mode DELETE any product-attribute-definitions
elements
defined in the import file are ignored.
Complex Type: AttributeDefinition
The catalog.xsd complex type
AttributeDefinition
supports the site-specific-flag
attribute.
Attribute: System
Site-specific values for system attributes are supported via catalog import and export.
Attribute: Custom
Site-specific values for custom attributes are supported via catalog import and export.
<online-flag site-id="MySiteAmerica">false</online-flag>
Element: Variants
Attribute: Merge-Mode
The merge-mode
attribute overrides the specified MERGE
semantic for specific variants
element in UPDATE, MERGE, and REPLACE modes. The
attribute has these possible values: add, merge, replace,
and
remove.
It is unnecessary to use the attribute in REPLACE mode, because that mode automatically removes all variation products before replacing them with the variation products listed in the feed.
This means you can choose to add variations and remove variations by adding them
to separate variants
elements. You can only have one variants element and mode
per variations element and product.
<product product-id="28447">
...
<variations>
<variants merge-mode="add">
<variation product-id="883239585285"/>
<variation product-id="883239585289"/>
</variants>
</variations>
</product>
<product product-id="28447">
...
<variations>
<variants merge-mode="remove">
<variation product-id="883239585281"/>
<variation product-id="883239585282"/>
<variation product-id="883239585283"/>
</variants>
</variations>
</product>
<product product-id="28447">
...
<variations>
<variants merge-mode="replace">
<variation product-id="883239585287"/>
</variants>
</variations>
</product>
Sorting of variation products and variation attribute values on Import
You can control the sorting of variation products and variation attribute values during catalog import. This is useful if you need to preserve the sort order of existing variation products and variation attribute values when importing.
merge
is
specified for the merge-mode
attribute of the
variation-attribute-values
and variants
elements, the importer
handles the values as follows: merge-mode
attribute isn't specified in the file, the importer
completely replaces the list stored in the system with the values in the import file. The import
uses the default replace
semantic for lists of elements.