projects/congarevenuecloud/ecommerce/src/lib/modules/pricing/services/price.service.ts
This service is a work in progress.
Price service provides a way of retrieving price for various points in the ecommerce application. Different price points are product price, product option price, order and quote totals.
import { PriceService, AObjectService} from '@congarevenuecloud/ecommerce';
export class MyComponent implements OnInit{
constructor( private priceService: PriceService)
}
// or
export class MyService extends AObjectService {
private priceService: PriceService = this.injector.get(PriceService);
}
Properties |
Methods |
constructor(priceListService: PriceListService, localCurrencyPipe: LocalCurrencyPipe, storefrontService: StorefrontService)
|
||||||||||||
Parameters :
|
Static adjustValue |
Method calcuates the adjustment amount for a line item based on its adjustment type. |
adjustValue()
|
Method calcuates the adjustment amount for a line item based on its adjustment type.
Returns :
void
|
getAttributePriceForProduct |
Method returns a price for a given attribute and its value on a product |
getAttributePriceForProduct()
|
Method returns a price for a given attribute and its value on a product
Returns :
void
|
getCartPrice |
Method returns the price for a given cart. If the first parameter is left blank, it will return the price for the current cart. |
getCartPrice()
|
Method returns the price for a given cart. If the first parameter is left blank, it will return the price for the current cart.
Returns :
void
|
getLineItemPrice |
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. |
getLineItemPrice()
|
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.
Returns :
void
|
getOptionAdjustmentPrice | ||||||||
getOptionAdjustmentPrice(option: ProductOptionComponent)
|
||||||||
Method is used to retrieve the price of an option for a given product Example:Example :
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the given option |
getOrderLineItemPrice |
Method returns price for a given OrderLineItem instance. |
getOrderLineItemPrice()
|
Method returns price for a given OrderLineItem instance.
Returns :
void
|
getOrderPrice | ||||||||
getOrderPrice(order: Order)
|
||||||||
Method returns a price for a given order instance. Example:Example :
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the order |
getProductPrice | ||||||||||||
getProductPrice(product: Product, chargeType?: ChargeType)
|
||||||||||||
Method is used to retrieve the price for a given product. Example:Example :
/**
Parameters :
Returns :
Observable<Price>
a hot observable containing the price instance for the given product. |
getQuoteLineItemPrice |
Method returns a NetPrice for a given QuoteLineItem instance. |
getQuoteLineItemPrice()
|
Method returns a NetPrice for a given QuoteLineItem instance.
Returns :
void
|
getQuotePrice | ||||||||
getQuotePrice(quote: Quote)
|
||||||||
Method returns a price for a given Quote instance. Example:Example :
Parameters :
Returns :
Observable<Price>
a hot observable containing the price of the Quote |
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>
|