projects/apttus/ecommerce/src/lib/modules/cart/services/cart.service.ts
AObjectService
Properties |
Methods |
| abandonCart | ||||||
abandonCart(cartId: string)
|
||||||
|
Parameters :
Returns :
Observable<boolean>
|
| addOptionToBundle | ||||||||||||
addOptionToBundle(bundleId: string, payload: CartRequest)
|
||||||||||||
|
Adds an option product to a bundle product that is already in the current active cart. Example:
Parameters :
Returns :
Observable<Array<CartItem>>
|
| addProductToCart | |||||||||||||||||||||||||
addProductToCart(product: Product, quantity: number, cartItems?: Array
|
|||||||||||||||||||||||||
|
Adding a Product to Cart is the most common Cart action. Will trigger a reprice operation asynchronously. Example:
Parameters :
Returns :
Observable<Array<CartItem>>
a void observable when the operation is complete |
| childCart |
childCart()
|
|
To render the iFrame, a business object Id must be determined by the client. The Business Object Id can be retrieved from a child cart associated with the primary cart. To retrieve this child cart, this method will be invoked.
Returns :
Observable<Cart>
|
| createNewCart | ||||||||||||||||||||
createNewCart(cartData: Cart, insert: boolean, active: boolean)
|
||||||||||||||||||||
|
Creates a new cart. Will set the account id, price list id, effective price list id on the cart and set the status to 'New' Example:
Parameters :
Returns :
Observable<Cart>
a cold cart observable with the populated cart after inserting into the database |
| deleteCart | ||||||||
deleteCart(cart: Cart | Array
|
||||||||
|
Deletes a specified cart instance from the database Example:
Parameters :
Returns :
Observable<boolean>
a cold boolean observable representing the success state of the delete operation |
| getCartWithId | ||||||
getCartWithId(cartId: string)
|
||||||
|
Parameters :
Returns :
Observable<Cart>
|
| getMyCart | ||||||||
getMyCart(pending: boolean)
|
||||||||
|
The primary method to get the user's current cart. This is a hot observable that will be updated when the state of the cart changes. Example:
Parameters :
Returns :
Observable<Cart>
A hot observable containing the single cart instance |
| isPricePending | ||||||||
isPricePending(cart: Cart)
|
||||||||
|
The isPricepending method checks the cart is pricepending flag and return the boolean value.
Parameters :
Returns :
boolean
boolean value of cart is Pricepending flag. |
| priceCart | ||||||||||
priceCart(pricingMode: string)
|
||||||||||
|
priceCart method triggers the server-side pricing engine for the cart Example:Price active cart and publishing its state to all subscribing components.
Parameters :
Returns :
void
|
| refreshCart |
refreshCart()
|
|
Price active cart and publishing its state to all subscribing components.
Returns :
void
|
| removeCartItem | ||||||||||||||||||||
removeCartItem(cartItem: CartItem, async: boolean, trigger: boolean)
|
||||||||||||||||||||
|
Removes the specified cart item from the cart. Will trigger a reprice cart operation. Example:
Parameters :
Returns :
Observable<void>
a void observable when the operation completes |
| setCartActive | ||||||
setCartActive(cart: Cart)
|
||||||
|
setActiveCart: Method sets the selected cart as active and deactivates any other carts Example:
Parameters :
Returns :
Observable<Cart>
Observable |
| updateCartItems | ||||||||
updateCartItems(cartItemList: Array
|
||||||||
|
Update fields on the items specified in the cart item array. Will trigger a reprice cart operation. Example:
Parameters :
Returns :
Observable<Array<CartItem>>
a void observable when the operation has completed. |
| onCartError |
Type : EventEmitter<CartError>
|
Default value : new EventEmitter<CartError>()
|
| type |
Default value : Cart
|