Assortments

An assortment is a subset of products which are shown to select users only, e.g. in white label scenarios.

Assortments in Dynamicweb are created and managed from the Assortments node (Figure 1.1).

Figure 1.1 Assortments are located in the eCommerce > Product Catalog tree

To create an assortment:

  • Right-click the Assortments node
  • Click New assortment to open the edit assortment interface (Figure 2.1)
Figure 2.1 Creating a new assortment

Here you must:

  • Provide a name for the assortment (you can create localized names with the flag-button in the ribbon bar)
  • Check the active checkbox (or leave it unchecked, if you want to disable the assortment)
  • Decide if you want to include (product) subgroups in the assortment selection.

In the Frontend group(s) and user(s) section, you can add the users and user groups which should be given access to the products in this assortment.

If you create a particular assortment targeted at anonymous users, remember to check the Anonymous users checkbox.

An assortment is meant to contain a particular subset of products, namely the products which should be available for a specific subset of your user base.

To add content to an assortment:

  • In the ribbon bar, click on the attached shops, attached groups or attached products button (Figure 3.1) – whichever is appropriate
Figure 3.1 Add Ecommerce content to an assortment using these buttons

This opens an overview of he  currently attached shops/product groups/products (Figure 3.2).

Figure 3.2 Content added to an assortment

From the assortment content view you can:

  • Delete a shop/group/product from the assortment by clicking the red delete-icon (X)
  • Add a new shop/group/product to the assortment by clicking the green plus-icon

Once content has been added to an assortment, it must be saved and (re)built.

To (re)build it, right click the assortment in the eCommerce tree and click rebuild assortment (Figure 3.3).

Figure 3.3 Rebuilding (populating) an assortment

The rebuild-task is set to run automatically every five minutes, so if you’re not in a hurry just have a cup of coffee or tea. Maybe a biscuit. Go on. You deserve it.

In order to use assortments in the frontend, you must enable them under Settings > Ecommerce > Advanced configuration > Assortments (Figure 5.1).

Figure 5.1 Activate assortment by checking this box

When assortments are enabled, the selected Ecommerce content is only available to the logged-in users specified on the assortment, and the standard Ecommerce navigation provider is replaced with an assortment navigation provider – which only renders groups containing valid products or subgroups with valid products.

When logged in, a user can see the products in an assortment they have access to alongside regular products in the Product Catalog (if any exist, of course).

Most solutions publish product data in frontend by querying a product index. It is important to remember that while an index contains information about assortments per user, changes are only shown in frontend after the index has been rebuilt.

When defining the product query you can use the macro Dynamicweb.UserManagement.Context.AssortmentIDs to show products in an assortment related to the logged-in user.

The example query in Figure 6.1 shows:

  • All products NOT in an assortment
  • All products in one or more assortments related to the logged-in user
database

These are the database tables relevant to Assortments:

EcomAssortments

Defines assortments.

Field name Data type Length
AssortmentID nvarchar 50
AssortmentLanguageID nvarchar 50
AssortmentName nvarchar 255
AssortmentNumber nvarchar 255
AssortmentPeriodID nvarchar 50
AssortmentLastBuildDate datetime 8
AssortmentRebuildRequired bit 1
AssortmentAutoID int 4
AssortmentActive bit 1
AssortmentIncludeSubgroups bit 1
AssortmentAllowAnonymousUsers bit 1

EcomAssortmentItems

Contains an index of products which are members of an assortment – the index needs to be built when products or assortment is changed.

Field name Data type Length
AssortmentItemAssortmentID nvarchar 50
AssortmentItemRelationAutoID int 4
AssortmentItemRelationType nvarchar 50
AssortmentItemLanguageID nvarchar 50
AssortmentItemProductID nvarchar 30
AssortmentItemProductVariantID nvarchar 255
AssortmentItemAutoID bigint 8

EcomAssortmentShopRelations

Link shops (AssortmentShopRelationShopID) to assortments (AssortmentShopRelationAssortmentID).

Field name Data type Length
AssortmentShopRelationAssortmentID nvarchar 50
AssortmentShopRelationShopID nvarchar 255
AssortmentShopRelationAutoID int 4

EcomAssortmentGroupRelations

Links Product Groups (AssortmentGroupRelationGroupID) to Assortments (AssortmentGroupRelationAssortmentID).

Field name Data type Length
AssortmentGroupRelationAssortmentID nvarchar 50
AssortmentGroupRelationGroupID nvarchar 255
AssortmentGroupRelationAutoID int 4

EcomAssortmentProductRelations

Links products (AssortmentProductRelationProductID) to Assortments (AssortmentProductRelationAssortmentID).

Field name Data type Length
AssortmentProductRelationAssortmentID nvarchar 50
AssortmentProductRelationProductID nvarchar 30
AssortmentProductRelationProductVariantID nvarchar 255
AssortmentProductRelationAutoID int 4
AssortmentProductRelationProductNumber nvarchar 255

EcomAssortmentPermissions

Controls user (AssortmentPermissionAccessUserID) access to assortments (AssortmentPermissionAssortmentID).

Field name Data type Length
AssortmentPermissionAssortmentID nvarchar 50
AssortmentPermissionAccessUserID int 4
AssortmentPermissionAutoID int 4