How do document types differ from e-commerce products?

   —   
If you want to create a new product on your site and specify its properties, you create a new document in the content tree and assign an e-commerce product (SKU). If your product has some custom properties, you can decide if they should be properties of a document type or SKU. This article explains a difference between document types and e-commerce products (SKU-s) in general.
Document types define a structure of documents in the content tree. There can be many document types in your system and every time you create a new document, you can choose its document type. A document type stores custom fields in a document type table (for example: CONTENT_News) which you can specify when you create a new document type in Site manager -> Development -> Document types. In this location you can also change the document type fields. Then you can edit values of document type properties on CMSDesk -> Content -> edit document -> Form tab.

SKU is a basic class for all products in the E-commerce module. It shares the properties (fields) for all the products (for example: SKUPrice or SKUDescription). You can manage the properties in Site manager -> Development -> System tables -> E-commerce – SKU. If you want to check values in your database, they use a table called COM_SKU. You can find all the products listed in CMSDesk -> Tools -> E-commerce -> Products. You can edit the products there or on CMSDesk -> Content -> edit document -> Product tab.

If you want to add a new product to your live site, you firstly choose a document that will act as a container for the product and then you assign the given product to the chosen document. While creating document, you can also choose to create the document and product at the same time and the product will be assign to the given document automatically. Then you can manage the document type fields on the Form tab and SKU properties on the Product tab.

You can also map the document type properties to SKU properties like: Mapping document fields to product properties. It means that there can be a document type field called Price and if you change the value on the Form tab, it also updates SKU on the Product tab. Please note that it does not work vice and versa. If you change the price on the Product tab, it does not change the price on the Form tab.

Both document type properties and SKU properties can be displayed in the transformations on the live site. You can simply use: <%# Eval("<fieldname>") %> to display a current value of SKU or document type field.

If you decide where to add a custom field, ask yourself whether the property is common for all the products on your site, or not. If it is a specific property, we would recommend you the document type fields (Site manager -> Development -> Document types). If the property belongs to all the products, you can add it as a new field for SKU (Site manager -> Development -> System tables -> E-commerce – SKU).

You can also consider the fact that if you add a product to the shopping cart, it works with SKU not a document. It means you can access the SKU properties but not the document type ones in the check-out process.

The fact that products are defined separately enables them to be independent of the document structure of a specific website. This allows you to use the same product on multiple sites.

-hg-


See also: Products

Applies to: all
Share this article on   LinkedIn