Skip to content
On this page

useProductSearch

Definition

Composable for product search.

Signature

ts
export function useProductSearch(): {
  search: (
    productId: string,
    options?: {
      withCmsAssociations?: boolean;
      criteria?: Partial<ShopwareSearchParams>;
    },
  ) => Promise<ProductResponse>;
} 

Return type

ts
{
  search: (
    productId: string,
    options?: {
      withCmsAssociations?: boolean;
      criteria?: Partial<ShopwareSearchParams>;
    },
  ) => Promise<ProductResponse>;
}

Properties

NameTypeDescription

Usage

ts
import { useProductSearch } from "@shopware-pwa/composables-next";

const { search } = useProductSearch();
useProductSearch has loaded