Options
All
  • Public
  • Public/Protected
  • All
Menu

Class that defines all cartItems.

Hierarchy

  • CartItems

Index

Constructors

constructor

Properties

crossActionMessages

crossActionMessages: any[] = []

Stores cross action messages.

Optional customFields

customFields: any = {}

custom attributes for an offer

messages

messages: any[] = []

Stores error messages.

prices

prices: any = {}

Stores all totalBar Prices information.

records

records: CartItem[] = []

Stores all cartItems.

Methods

Private cloneDeep

  • cloneDeep(obj: any): any
  • This function will perform deep cloning of an given object.

    Parameters

    • obj: any

    Returns any

insertLineItemToParent

  • insertLineItemToParent(parentInCardData: any, toBeAddedLineItem: any): any
  • This function will insert lineItem to the parent.

    Parameters

    • parentInCardData: any
    • toBeAddedLineItem: any

    Returns any

removeAddonFromParent

  • removeAddonFromParent(parentInCardData: any, toBeRemovedAddonId: any): void
  • This function will remove child product from the parent.

    Parameters

    • parentInCardData: any
    • toBeRemovedAddonId: any

    Returns void

removeLineItemFromParent

  • removeLineItemFromParent(parentInCardData: any, toBeRemovedLineItem: any): any
  • This function will remove lineItem from the parent.

    Parameters

    • parentInCardData: any
    • toBeRemovedLineItem: any

    Returns any

Private replacePrices

  • replacePrices(product: any, prices: any): Promise<any>
  • This function will update prices to the given product. Invoked by updatePrices() function

    Parameters

    • product: any
    • prices: any
      • @return {any} - prices

    Returns Promise<any>

updatePrices

  • updatePrices(product: any, prices: any): Promise<any>
  • This function will update prices to the entire bundle recursively.

    Parameters

    • product: any
    • prices: any

    Returns Promise<any>

Static findAndReplaceLineItem

  • findAndReplaceLineItem(product: any, idToBeSearched: any, replaceItem?: any, returnParent?: boolean): any
  • This function will search an productGroup/LineItem with in given bundle

    Parameters

    • product: any
    • idToBeSearched: any
    • Optional replaceItem: any
    • Optional returnParent: boolean

    Returns any

Static parse

  • parse(cartItemsResponse: any, input: any): CartItems
  • This function parse the cartItem.

    Parameters

    • cartItemsResponse: any
    • input: any

    Returns CartItems

Static update

  • update(parentObj: any, lineItemObj: any, parentRootBundle: any, updatedPrices: any): Promise<any>
  • This function updates updated product to the cartItem/bundle.

    Parameters

    • parentObj: any
    • lineItemObj: any
    • parentRootBundle: any
    • updatedPrices: any

    Returns Promise<any>

Static updateDeleteItem

  • updateDeleteItem(parentObj: any, childProductObj: any, parentRootBundle: any, updatedPrices: any, deleteItemInput?: any): Promise<any>
  • This function remove lineItem and add it back to child products array. Also update InCartQuantityMap Object.

    Parameters

    • parentObj: any
    • childProductObj: any
    • parentRootBundle: any
    • updatedPrices: any
    • Optional deleteItemInput: any

    Returns Promise<any>

Generated using TypeDoc