Interface IGarmentInformationProvider

The Garment Information Provider is used to retrieve detailed information about garments, such as their name, brand, availability, and more.

To improve loading times, the preLoad function of the IGarmentInformationProvider will be called with a list of all required garments. This allows a custom implementation to fetch information for multiple garments in a single batch request from a remote system such as a server and cache the results for efficient reuse.

interface IGarmentInformationProvider {
    getBrand?(reference: AssetReference): Awaitable<undefined | string>;
    getDetailLink(reference: AssetReference): Awaitable<undefined | string>;
    getName(reference: AssetReference): Awaitable<undefined | string>;
    getPrice(reference: AssetReference): Awaitable<undefined | {
        currency: string;
        price: number;
        strikePrice?: number;
    }>;
    getSizes?(id: ReferenceData): Awaitable<ItemSize[]>;
    isAvailable?(reference: AssetReference): Awaitable<boolean>;
    preLoad?(items: AssetReference[]): Awaitable<void>;
}

Methods

  • The price of the garment, in case no price is provided in the commerce provider. This acts as fallback.

    Parameters

    Returns Awaitable<undefined | {
        currency: string;
        price: number;
        strikePrice?: number;
    }>

  • If this methods is defined, it can be used to determine if a garment should be used in the expirience. If this methods returns false, that garment is removed from the garment selection AND all outfits that reference this garment are also removed and not available!

    Parameters

    Returns Awaitable<boolean>