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<Schemas["Criteria"]>;
    },
  ) => Promise<Schemas["ProductDetailResponse"]>;
} 

Return type ​

ts
{
  search: (
    productId: string,
    options?: {
      withCmsAssociations?: boolean;
      criteria?: Partial<Schemas["Criteria"]>;
    },
  ) => Promise<Schemas["ProductDetailResponse"]>;
}

Properties ​

NameTypeDescription

Usage ​

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

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