Click or drag to resize
GtmProductHelperMapShoppingCartItemsInternal Method
Maps shopping cart items to collection of GtmData that represents properties and values of Google Tag Manger products.

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 12.0.0
Syntax
C#
protected virtual IEnumerable<GtmData> MapShoppingCartItemsInternal(
	IEnumerable<ShoppingCartItemInfo> cartItems,
	Object additionalData = null,
	string purpose = null
)

Parameters

cartItems
Type: System.Collections.GenericIEnumerableShoppingCartItemInfo
Shopping cart items to be mapped.
additionalData (Optional)
Type: SystemObject
Data with additional non-conflicting key value pairs to be merged with every ShoppingCartItemInfo.
purpose (Optional)
Type: SystemString
Contextual information fitting for customizations.

Return Value

Type: IEnumerableGtmData
The GtmData that represents Google Tag Manger product object.
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when cartItems is null.
Examples

To customize returned gtmData override this method in similar fashion.

base.MapCartItemsInternal(gtmObject, additionalData, purpose);

gtmData.Add("key", "value");

To customize the whole mapping process do not call base implementation.

See Also