import { DaffConfigurableProductFacadeInterface } from '@daffodil/product-configurable/state'
An interface for a facade that accesses configurable product state. Exposes many parts of the state for easy access and allows dispatching of actions.
interface DaffConfigurableProductFacadeInterface<T extends DaffConfigurableProduct = DaffConfigurableProduct> {
getAllAttributes(id: string): Observable<Dictionary<string[]>>
getAllVariants(id: string): Observable<Array<T['variants'][number]>>
getAppliedAttributes(id: string): Observable<Dictionary<string>>
getMinimumPrice(id: string): Observable<number>
getMaximumPrice(id: string): Observable<number>
getMinimumDiscountedPrice(id: string): Observable<number>
getMaximumDiscountedPrice(id: string): Observable<number>
getMinimumPercentDiscount(id: string): Observable<number>
getMaximumPercentDiscount(id: string): Observable<number>
isPriceRanged(id: string): Observable<boolean>
hasDiscount(id: string): Observable<boolean>
getSelectableAttributes(id: string): Observable<Dictionary<string[]>>
getMatchingVariants(id: string): Observable<Array<T['variants'][number]>>
}
Observable>
All attributes of a configurable product.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable>
All variants of a configurable product.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable>
The applied attributes of a configurable product.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Get the current minimum price possible based on the applied attributes and remaining variants.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Get the current maximum price possible based on the applied attributes and remaining variants.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Get the current minimum discounted price possible based on the applied attributes and remaining variants.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Get the current maximum discounted price possible based on the applied attributes and remaining variants.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Get the current minimum percent discount possible based on the applied attributes and remaining variants.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Get the current maximum percent discount possible based on the applied attributes and remaining variants.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Returns whether the possible price for the configurable product is a range of different prices
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable
Returns whether the variants of the configurable product have (a) discount(s)
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable>
Selectable configurable product attributes derived from the remaining variants and the order of currently applied attributes. The remaining variants of the product are derived from the currently applied attributes.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |
Observable>
The variants that match the applied attributes of a configurable product.
Parameter | id: string |
---|---|
Description | the id of the configurable product. |