Options for configuring the ProductSearch component.

interface ProductSearchOptions {
    services: {
        catalogApi: Pick<CatalogApi<unknown, unknown, unknown>, "listCategories" | "listProductsForActiveStatus">;
    };
    settings: {
        filterProductsRoute: string;
        nameForCategory?: ((name, t) => string);
        numberOfProductsPerPage: number;
        productRoute: string;
    };
    views?: {
        List?: FC<ProductSearchDefaultListViewProps>;
    };
}

Properties

services: {
    catalogApi: Pick<CatalogApi<unknown, unknown, unknown>, "listCategories" | "listProductsForActiveStatus">;
}

Type declaration

  • catalogApi: Pick<CatalogApi<unknown, unknown, unknown>, "listCategories" | "listProductsForActiveStatus">

    Catalog API for listing products. Contains methods for listing products with active status and listing categories.

settings: {
    filterProductsRoute: string;
    nameForCategory?: ((name, t) => string);
    numberOfProductsPerPage: number;
    productRoute: string;
}

Type declaration

  • filterProductsRoute: string

    Route used for applying filters.

  • Optional nameForCategory?: ((name, t) => string)

    Function to generate a name for categories. Used for translating category names. Default behavior will use the translation given by Geekle:categories.${name}.

      • (name, t): string
      • Function to generate a name for categories. Used for translating category names. Default behavior will use the translation given by Geekle:categories.${name}.

        Parameters

        • name: string
        • t: TFunction<"translation", undefined>

        Returns string

  • numberOfProductsPerPage: number

    Number of products listed by default.

  • productRoute: string

    Route used to navigate to when clicking on an item.

views?: {
    List?: FC<ProductSearchDefaultListViewProps>;
}

Type declaration

Generated using TypeDoc