Skip to content
On this page

createListingComposable ​

Definition ​

Factory to create your own listing.

By default you can use useListing composable, which provides you predefined listings for category(cms) listing and product search listing. Using factory you can provide our own compatible search method and use it for example for creating listing of orders in my account.

Signature ​

ts
export function createListingComposable<ELEMENTS_TYPE>({
  searchMethod,
  searchDefaults,
  listingKey,
}: {
  searchMethod(
    searchParams: Partial<ShopwareSearchParams>,
  ): Promise<ListingResult<ELEMENTS_TYPE>>;
  searchDefaults: ShopwareSearchParams;
  listingKey: string;
}): UseListingReturn<ELEMENTS_TYPE> 

Parameters ​

NameTypeDescription
{ searchMethod, searchDefaults, listingKey, }
{
  searchMethod(
    searchParams: Partial<ShopwareSearchParams>,
  ): Promise<ListingResult<ELEMENTS_TYPE>>;
  searchDefaults: ShopwareSearchParams;
  listingKey: string;
}

Return type ​

ts
UseListingReturn<ELEMENTS_TYPE>

Properties ​

NameTypeDescription

Methods ​

NameTypeDescription

Usage ​

vue
<script setup lang="ts">
// TODO: add example
</script>
createListingComposable has loaded