GitHub

DaffConfigurableProductFacadeInterface

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 {
  getAllAttributes(id: string): Observable<Dictionary<string[]>>
  getAllVariants(id: string): Observable<DaffConfigurableProductVariant[]>
  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<DaffConfigurableProductVariant[]>
}

() Methods

getAllAttributes
Observable<Dictionary<string[]>>

All attributes of a configurable product.

Parameters
Parameterid: string
Description

the id of the configurable product.

getAllVariants
Observable<DaffConfigurableProductVariant[]>

All variants of a configurable product.

Parameters
Parameterid: string
Description

the id of the configurable product.

getAppliedAttributes
Observable<Dictionary<string>>

The applied attributes of a configurable product.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMinimumPrice
Observable<number>

Get the current minimum price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMaximumPrice
Observable<number>

Get the current maximum price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMinimumDiscountedPrice
Observable<number>

Get the current minimum discounted price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMaximumDiscountedPrice
Observable<number>

Get the current maximum discounted price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMinimumPercentDiscount
Observable<number>

Get the current minimum percent discount possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMaximumPercentDiscount
Observable<number>

Get the current maximum percent discount possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description

the id of the configurable product.

isPriceRanged
Observable<boolean>

Returns whether the possible price for the configurable product is a range of different prices

Parameters
Parameterid: string
Description

the id of the configurable product.

hasDiscount
Observable<boolean>

Returns whether the variants of the configurable product have (a) discount(s)

Parameters
Parameterid: string
Description

the id of the configurable product.

getSelectableAttributes
Observable<Dictionary<string[]>>

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.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMatchingVariants
Observable<DaffConfigurableProductVariant[]>

The variants that match the applied attributes of a configurable product.

Parameters
Parameterid: string
Description

the id of the configurable product.