GitHub

DaffConfigurableProductFacadeInterface

Type

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): any
  getAllVariants(id: string): any
  getAppliedAttributes(id: string): any
  getMinimumPrice(id: string): any
  getMaximumPrice(id: string): any
  getMinimumDiscountedPrice(id: string): any
  getMaximumDiscountedPrice(id: string): any
  getMinimumPercentDiscount(id: string): any
  getMaximumPercentDiscount(id: string): any
  isPriceRanged(id: string): any
  hasDiscount(id: string): any
  getSelectableAttributes(id: string): any
  getMatchingVariants(id: string): any
}

() Methods

getAllAttributes
any

All attributes of a configurable product.

Parameters
Parameterid: string
Description

the id of the configurable product.

getAllVariants
any

All variants of a configurable product.

Parameters
Parameterid: string
Description

the id of the configurable product.

getAppliedAttributes
any

The applied attributes of a configurable product.

Parameters
Parameterid: string
Description

the id of the configurable product.

getMinimumPrice
any

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
any

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
any

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
any

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
any

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
any

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
any

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
any

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

Parameters
Parameterid: string
Description

the id of the configurable product.

getSelectableAttributes
any

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
any

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

Parameters
Parameterid: string
Description

the id of the configurable product.