eb_shoppingCart Class
Shopping cart class.
Item Index
Methods
- eb_shoppingCart.addItemToCart
- eb_shoppingCart.addItemToCartService
- eb_shoppingCart.checkout
- eb_shoppingCart.emptyCart
- eb_shoppingCart.eventProductItems
- eb_shoppingCart.getEventProductItems
- eb_shoppingCart.getShoppingCart
- eb_shoppingCart.removeCartItem
- eb_shoppingCart.removeCartItem
- eb_shoppingCart.render
- eb_shoppingCart.shoppingCartModel
- eb_shoppingCart.updateCartItem
- eb_shoppingCart.updateCartItemService
- eb_shoppingCart.updateShoppingCart
- eb_shoppingCart.viewCartItems
- eb_shoppingCart.viewSubscriptionCartItems
Methods
eb_shoppingCart.addItemToCart
-
data
This method used to add product to cart. Based on the product type will call the service.
Parameters:
-
data
ObjectObject of required data.
-
newCartItem
BooleanBoolean value to specify whether item is added to the current cart for first time .
-
productId
NumberProduct ID.
-
productType
StringProduct type.
-
quantity
NumberQuantity.
-
Returns:
jQuery promise object return product details which we want to add in your cart
eb_shoppingCart.addItemToCartService
-
data
-
servicePath
This method used to add product to cart. Based on the product type will call the service.
Parameters:
-
data
ObjectHere data contains product id and quantity.
-
servicePath
StringService URL for the current product type.
Returns:
jQuery promise object return product details which we want to add in your cart.
eb_shoppingCart.checkout
-
data
This method is used to checkout cart.
Parameters:
-
data
ObjectCredit card details or purchase order number.
-
parameter
String"CreditCard" or "PurchaseOrder".
-
Returns:
jQuery promise return the id
eb_shoppingCart.emptyCart
()
String
This method is used to remove all cart items.
Returns:
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:
jQuery promise object return event product Items
eb_shoppingCart.getEventProductItems
-
cartItems
This method is used to view cart items with event product. The service call will return shopping cart data.
Parameters:
-
cartItems
StringcartItems in view cart
Returns:
jQuery promise object return event product Items
eb_shoppingCart.getShoppingCart
()
Object
This method is used to get shopping cart record.
Returns:
jQuery promise return shopping cart details
eb_shoppingCart.removeCartItem
-
data
This method used to remove product from cart.
Parameters:
-
data
ObjectProduct id.
Returns:
jQuery promise object return product details which we want remove from cart
eb_shoppingCart.removeCartItem
-
data
This method used to remove product from cart.
Parameters:
-
data
ObjectProduct id.
Returns:
jQuery promise return undefined
eb_shoppingCart.render
-
options
The service will return shopping cart HTML.
Parameters:
-
options
AnyArray of required data.
-
templatePath
StringShopping cart template URL.
-
Returns:
jQuery promise object which when resolved returns HTML template.
eb_shoppingCart.shoppingCartModel
-
options
Shopping cart model responsible to all shopping cart operations.
Parameters:
-
options
AnyObject of cart data.
-
cartItems
ObjectList of cart items.
-
domElement
ObjectShopping cart DOM element.
-
shoppingCartData
ObjectShopping cart data.
-
eb_shoppingCart.updateCartItem
-
data
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
ObjectHere data contains product id, product type and quantity.
Returns:
jQuery promise object return updated product details
eb_shoppingCart.updateCartItemService
-
data
-
servicePath
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
ObjectHere data contains product id and quantity.
-
servicePath
StringService URL for the current product type.
Returns:
jQuery promise object return updated product details.
eb_shoppingCart.updateShoppingCart
-
data
This method is used to update shopping cart's couponId, couponName, shippingAddressId and billingAddressId.
Parameters:
-
data
ObjectBilling and shipping address ids.
Returns:
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:
jQuery promise object return view cart Items
eb_shoppingCart.viewSubscriptionCartItems
-
cartItems
This method is used to view cart items with subscription product. The service call will return shopping cart data.
Parameters:
-
cartItems
StringcartItems in view cart
Returns:
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.