Click or drag to resize
ShoppingService Class
Provides interaction with shopping cart.
Inheritance Hierarchy
SystemObject
  CMS.EcommerceShoppingService

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 12.0.0
Syntax
C#
public class ShoppingService : IShoppingService

The ShoppingService type exposes the following members.

Constructors
  NameDescription
Public methodShoppingService
Initializes a new instance of the ShoppingService class with supplied activity logger.
Top
Methods
  NameDescription
Public methodAddCouponCode
Applies the specified coupon code to the current shopping cart and evaluates the cart.
Public methodAddItemToCart(ShoppingCartItemParameters)
Adds an item to the current shopping cart and logs the activity. Saves the shopping cart if it has not been saved yet. If an item in such configuration is already present in the cart, its quantity is increased by Quantity. Saves all product options and bundle items after adding and evaluates the cart.
Public methodAddItemToCart(Int32, Int32)
Adds an item to the current shopping cart and logs the activity. Saves the shopping cart if it has not been saved yet. If an item in such configuration is already present in the cart, its quantity is increased by quantity. Saves all product options and bundle items after adding and evaluates the cart.
Public methodCalculateShippingOptionPrice
Returns price of the given shipping option based on the current shopping cart.
Public methodCreateOrder
Validates and creates order from current shopping cart. If order creation was successful empties shopping cart. If order requires an user account, handles its creation. Also tracks order conversion, sends order notifications and logs purchase activities.
Public methodGetBillingAddress
Returns the billing address for the current shopping cart.
Protected methodGetCurrentContactId
Gets ID of the current contact.
Public methodGetCurrentCustomer
Gets the current customer.
Public methodGetCurrentShoppingCart
Gets the shopping cart used by the IShoppingService instance. The shopping cart is retrieved using the ICurrentShoppingCartService implementation this instance was initialized with. This member is a backing method of the get_CurrentShoppingCart property.
Public methodGetPaymentOption
Returns the selected payment option for the current shopping cart.
Public methodGetShippingAddress
Returns the shipping address for the current shopping cart.
Public methodGetShippingOption
Returns the selected shipping option for the current shopping cart.
Protected methodLogProductAddedToCartActivity
Logs the add to shopping cart activity.
Protected methodLogProductRemovedFromCartActivity
Logs the remove from shopping cart activity.
Protected methodLogPurchaseActivities
Logs all items in cart as purchased.
Public methodRemoveAllItemsFromCart
Removes all items from the current shopping cart. Also removes all children and bundle items from the cart, logs the activity and evaluates the cart.
Public methodRemoveCouponCode
Removes the specified coupon code from the current shopping cart and evaluates the cart.
Public methodRemoveItemFromCart(Int32)
Removes item with specified itemId from the current shopping cart. Also removes all children and bundle items from the cart, logs the activity and evaluates the cart.
Public methodRemoveItemFromCart(ShoppingCartItemInfo)
Removes item specified by shoppingCartItemInfo from the current shopping cart. Also removes all children and bundle items from the cart, logs the activity and evaluates the cart.
Public methodSaveCart
Validates and saves the shopping cart into the database.
Protected methodSendOrderNotifications
Sends notifications about created order to administrator and customer.
Protected methodSetAddress
Sets address to the database. Assigns AddressCustomerID/>. Sets AddressName to address if not already set.
Public methodSetBillingAddress
Sets billing address to the current shopping cart and evaluates the cart.
Protected methodSetBillingAddressInternal
Sets billing address to the current shopping cart, evaluates the cart and persists changes in the database if the persistShoppingCart is true.
Protected methodSetCartItem
Sets or updates cart item, its product options and bundle items to the database.
Public methodSetCustomer
Sets the given customer to the current shopping cart and persists changes in the database.
Protected methodSetCustomerInternal
Sets the given customer to the current shopping cart and persists changes in the database if the persistShoppingCart is true.
Public methodSetPaymentOption
Sets the selected payment option to the current shopping cart, and evaluates and saves it. Does nothing if paymentOptionId is the same as the cart already has.
Protected methodSetPaymentOptionInternal
Sets the selected payment option to the current shopping cart, evaluates it and persists changes in the database if the persistShoppingCart is true. Does nothing if paymentOptionId is the same as the cart already has.
Public methodSetShippingAddress
Sets shipping address to the current shopping cart and evaluates the cart.
Protected methodSetShippingAddressInternal
Sets shipping address to the current shopping cart, evaluates the cart and persists changes in the database if the persistShoppingCart is true.
Public methodSetShippingOption
Sets the selected shipping option to the current shopping cart, evaluates it and persists changes in the database. Does nothing if shippingOptionId is the same as the cart already has.
Protected methodSetShippingOptionInternal
Sets the selected shipping option to the current shopping cart, evaluates it and persists changes in the database if the persistShoppingCart is true. Does nothing if shippingOptionId is the same as the cart already has.
Protected methodTrackOrderConversion
Tracks order conversion of the provided cart.
Public methodUpdateItemQuantity(Int32, Int32)
Updates the quantity of a shopping cart item specified by itemId to quantity. Logs the activity resulting from the actual amount of items added or removed and evaluates the cart.
Public methodUpdateItemQuantity(ShoppingCartItemInfo, Int32)
Updates the quantity of a shopping cart item specified by shoppingCartItemInfo to quantity. Logs the activity resulting from the actual amount of items added or removed and evaluates the cart.
Protected methodValidateAddItemToCart
Validates adding an item to the shopping cart via AddItemToCart(ShoppingCartItemParameters). The method validates whether an item being added belongs to the same site as current shopping cart. Throws an exception when validation fails.
Protected methodValidateCreateOrder
Validates cart for which order is being created.
Protected methodValidateSetBillingAddress
Validates billing address which is to be set to the current shopping cart.
Protected methodValidateSetPaymentOption
Validates whether a payment option is assigned to the same site as the current shopping cart or the payment option is a global object.
Protected methodValidateSetShippingAddress
Validates shipping address which is to be set to the current shopping cart.
Protected methodValidateShippingOption
Validates whether a shipping option is assigned to the same site as the current shopping cart or the shipping option is a global object.
Protected methodValidateShoppingCart
Validates the shopping cart and its items.
Top
See Also