projects/apttus/ecommerce/src/lib/modules/pricing/services/price.service.ts
Client-side pricing engine for retrieving price for various points in the ecommerce application. NOTE: It is not guarunteed that this service will always return accurate pricing for a given cart. You should always call cartService.priceCart(...) to trigger the server-side pricing engine to get the final price of a given cart. There are also pipes provided that wrap this service to provide pricing within a template (i.e. ProductPricePipe, OrderPricePipe, CartPricePipe etc...)
Properties |
Methods |
constructor(priceListService: PriceListService, cartService: CartService, priceMatrixService: PriceMatrixService, metadataService: MetadataService, localCurrencyPipe: LocalCurrencyPipe, productAttributeValueService: ProductAttributeValueService, storefrontService: StorefrontService)
|
||||||||||||||||||||||||
|
Parameters :
|
| Static adjustValue | ||||||||||||||||
adjustValue(adjustmentAmount: number, adjustmentType: string, amount: number)
|
||||||||||||||||
|
Method calcuates the adjustment amount for a line item based on its adjustment type.
Parameters :
Returns :
number
a numberic value representing the adjustment amount. |
| getAssetLineItemPrice | ||||||||
getAssetLineItemPrice(assetLineItem: AssetLineItem)
|
||||||||
|
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the asset line item |
| getAttributePriceForProduct | ||||||||||||||||
getAttributePriceForProduct(product: Product, attribute: ProductAttribute, attributeValue: any)
|
||||||||||||||||
|
Method returns a price for a given attribute and its value on a product
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of a given attribute value |
| getCartPrice | ||||||||
getCartPrice(cart$?: Observable
|
||||||||
|
Method returns the price for a given cart. If the first parameter is left blank, it will return the price for the current cart.
Parameters :
Returns :
Observable<Price>
A hot observable containing the price of the given cart |
| getLineItemPrice | |||||||||
getLineItemPrice(itemList: Array
|
|||||||||
|
Method returns a price instance for a given cart item. If the price for the item has already been calculated, it will not do client side calculation.
Parameters :
Returns :
Observable<Price>
A hot observable containing the price of the given cart item. |
| getOptionAdjustmentPrice | |||||||||||||||
getOptionAdjustmentPrice(option: ProductOptionComponent, quantity: number)
|
|||||||||||||||
|
Method is used to retrieve the price of an option for a given product
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the given option |
| getOrderLineItemPrice | ||||||
getOrderLineItemPrice(orderLI: OrderLineItem)
|
||||||
|
Method returns price for a given OrderLineItem instance.
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the LineItem |
| getOrderPrice | ||||||||
getOrderPrice(order: Order)
|
||||||||
|
Method returns a price for a given order instance.
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the order |
| getProductPrice | |||||||||||||||||||||||||||||||||||
getProductPrice(product: Product, quantity: number, term: number, attributeValue?: ProductAttributeValue, bundle: boolean, chargeType?: ChargeType)
|
|||||||||||||||||||||||||||||||||||
|
Method is used to retrieve the price for a given product.
Parameters :
Returns :
Observable<Price>
a hot observable containing the price instance for the given product |
| getQuoteLineItemPrice | ||||||
getQuoteLineItemPrice(quoteLI: QuoteLineItem)
|
||||||
|
Method returns a NetPrice for a given QuoteLineItem instance.
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the QuoteLineItem |
| getQuotePrice | ||||||||
getQuotePrice(quote: Quote)
|
||||||||
|
Method returns a price for a given Quote instance.
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the Quote |
| getRollupItemPrice | ||||||
getRollupItemPrice(item: CartItem | AssetLineItem | QuoteLineItem | OrderLineItem)
|
||||||
|
Parameters :
Returns :
Observable<Price>
|
| cartPending |
Type : boolean
|
Default value : false
|
| matrixData |
Type : object
|
Default value : {}
|
| previousCartPrice |
Type : Price
|
Default value : null
|
| queryKey |
Type : string
|
Default value : null
|
| queryList |
Type : Array<PriceListItem>
|