API Docs for:
Show:

eb_shoppingCart Class

Shopping cart class.

Methods

eb_shoppingCart.addItemToCart

(
  • data
)
Object

This method used to add product to cart. Based on the product type will call the service.

Parameters:

  • data Object

    Object of required data.

    • newCartItem Boolean

      Boolean value to specify whether item is added to the current cart for first time .

    • productId Number

      Product ID.

    • productType String

      Product type.

    • quantity Number

      Quantity.

Returns:

Object:

jQuery promise object return product details which we want to add in your cart

eb_shoppingCart.addItemToCartService

(
  • data
  • servicePath
)
Object

This method used to add product to cart. Based on the product type will call the service.

Parameters:

  • data Object

    Here data contains product id and quantity.

  • servicePath String

    Service URL for the current product type.

Returns:

Object:

jQuery promise object return product details which we want to add in your cart.

eb_shoppingCart.checkout

(
  • data
)
Object

This method is used to checkout cart.

Parameters:

  • data Object

    Credit card details or purchase order number.

    • parameter String

      "CreditCard" or "PurchaseOrder".

Returns:

Object:

jQuery promise return the id

eb_shoppingCart.emptyCart

() String

This method is used to remove all cart items.

Returns:

String:

jQuery promise return undefined

eb_shoppingCart.eventProductItems

() Object

This method is used to view cart items with event product. The service call will return shopping cart data.

Returns:

Object:

jQuery promise object return event product Items

eb_shoppingCart.getEventProductItems

(
  • cartItems
)
Object

This method is used to view cart items with event product. The service call will return shopping cart data.

Parameters:

  • cartItems String

    cartItems in view cart

Returns:

Object:

jQuery promise object return event product Items

eb_shoppingCart.getShoppingCart

() Object

This method is used to get shopping cart record.

Returns:

Object:

jQuery promise return shopping cart details

eb_shoppingCart.removeCartItem

(
  • data
)
Object

This method used to remove product from cart.

Parameters:

  • data Object

    Product id.

Returns:

Object:

jQuery promise object return product details which we want remove from cart

eb_shoppingCart.removeCartItem

(
  • data
)
Object

This method used to remove product from cart.

Parameters:

  • data Object

    Product id.

Returns:

Object:

jQuery promise return undefined

eb_shoppingCart.render

(
  • options
)
String

The service will return shopping cart HTML.

Parameters:

  • options Any

    Array of required data.

    • templatePath String

      Shopping cart template URL.

Returns:

String:

jQuery promise object which when resolved returns HTML template.

eb_shoppingCart.shoppingCartModel

(
  • options
)

Shopping cart model responsible to all shopping cart operations.

Parameters:

  • options Any

    Object of cart data.

    • cartItems Object

      List of cart items.

    • domElement Object

      Shopping cart DOM element.

    • shoppingCartData Object

      Shopping cart data.

eb_shoppingCart.updateCartItem

(
  • data
)
Object

This method used to update cart's item. Based on the product type will call the service. The service call will return updated shopping cart data.

Parameters:

  • data Object

    Here data contains product id, product type and quantity.

Returns:

Object:

jQuery promise object return updated product details

eb_shoppingCart.updateCartItemService

(
  • data
  • servicePath
)
Object

This method used to update cart's item. Based on the product type will call the service. The service call will return updated shopping cart data.

Parameters:

  • data Object

    Here data contains product id and quantity.

  • servicePath String

    Service URL for the current product type.

Returns:

Object:

jQuery promise object return updated product details.

eb_shoppingCart.updateShoppingCart

(
  • data
)
Object

This method is used to update shopping cart's couponId, couponName, shippingAddressId and billingAddressId.

Parameters:

  • data Object

    Billing and shipping address ids.

Returns:

Object:

jQuery promise return updated shopping cart details

eb_shoppingCart.viewCartItems

() Object

This method is used to view cart items. The service call will return shopping cart data.

Returns:

Object:

jQuery promise object return view cart Items

eb_shoppingCart.viewSubscriptionCartItems

(
  • cartItems
)
Object

This method is used to view cart items with subscription product. The service call will return shopping cart data.

Parameters:

  • cartItems String

    cartItems in view cart

Returns:

Object:

jQuery promise object return subscription cart Items

Properties

eb_shoppingCart.productType

Object Array of product type names.

Service URL based on product types.

eb_shoppingCart.ServicePath

String

SOA path. It would be set from configuration file.

eb_shoppingCart.serviceUrls

Object Object containing different shopping cart related service URLs.

Shopping cart service URLs.

eb_shoppingCart.SitePath

String

Site path. It would be set from configuration file.

eb_shoppingCart.TemplatePath

String

Shopping cart template path.