If you use a backend catalog management system to define attribute data or new product attributes, use catalog import to import new product attribute definitions into B2C Commerce. Also make sure that attributes managed via the backend system can't be edited in Business Manager.
Useful Elements for Managing Attributes
In the catalog.xsd, the product-attribute-definitions element uses the complexType.AttributeDefinitions type, which contains two useful elements:
externally-managed-flag- used to indicate that the custom attribute values are externally managed and can't be edited in Business Manager.externally-defined-flag- indicates whether the custom external system manages the custom attribute definition and then imports it into our system. This element is intended for merchants using Catalog Management Systems, where they manage their catalog data along with product meta data. Attribute definitions imported along with catalog information are implicitly marked asexternally-defined. There’s no way to set theexternally-defined-flagin Business Manager.
-
order-required-flag -
searchable
Product Object Custom Attribute Definitions
Custom product attribute definitions created in the catalog import can't be searchable or order-required. To prevent unintended changes to the storefront, change these attribute settings after catalog import.
Delete and Create Custom Product Attribute Definitions in a Single Feed
Delete obsolete attribute definitions and create attribute definitions in a single
feed using the product-attribute-definitions element in B2C Commerce.
- In UX Studio, in the pipeline that you use to import your catalog, locate the ImportCatalog pipelet.
-
In the ImportConfiguration parameter, enter
{importAttributeDefinitions:true}.If this option isn't set, the import process ignores the product-attribute-definition element and generates an error in the import log. -
From your backend system, generate a feed based on the catalog.xsd that has the
following:
- a
product-attribute-definitionselement for each new attribute definition you want to create. - To remove a product attribute definition that is externally defined,
make sure that it isn't included in the feed. Whether you’re importing
with the UPDATE, MERGE, or REPLACE mode, the replace semantic is always
used for
product-attribute-definitionselement, so the import removes any attribute definitions flagged externally defined in the database and not defined in the import file.
- a
-
Import the feed via a job.
Importing the feed manually in Business Manager ignores the
product-attribute-definitionselement when you import the feed manually.