You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -570,18 +594,57 @@ export async function parseUrlForProductsListSearch(
570
594
}
571
595
572
596
/**
573
-
* Load search service configuration from URL
597
+
* Load search service configuration from URL or parsed URL result.
598
+
* This function provides the configuration for the Products List Search service,
599
+
* including customizations and initial search state.
600
+
*
601
+
* @param {string | { searchOptions: productsV3.V3ProductSearch; initialSearchState: InitialSearchState }} input - Either a URL to parse or parsed URL result from parseUrlToSearchOptions
602
+
* @returns {Promise<ProductsListSearchServiceConfig>} Promise that resolves to the search service configuration
603
+
*
604
+
* @example
605
+
* ```tsx
606
+
* // Option 1: Load from URL (will parse filters, sort, pagination from URL params)
@@ -27,27 +29,33 @@ export type ProductsListServiceConfig = {
27
29
/**
28
30
* Loads products list service configuration from the Wix Stores API for SSR initialization.
29
31
* This function is designed to be used during Server-Side Rendering (SSR) to preload
30
-
* a list of products based on search criteria.
32
+
* a list of products based on search criteria or URL parameters.
31
33
*
32
-
* @param {productsV3.V3ProductSearch} searchOptions - The search options for querying products
34
+
* @param {string | { searchOptions: productsV3.V3ProductSearch; initialSearchState: InitialSearchState }} input - Either a URL to parse or parsed URL result from parseUrlToSearchOptions
33
35
* @returns {Promise<ProductsListServiceConfig>} Promise that resolves to the products list configuration
34
36
*
35
37
* @example
36
38
* ```astro
37
39
* ---
38
40
* // Astro page example - pages/products.astro
39
-
* import { loadProductsListServiceConfig } from '@wix/stores/services';
41
+
* import { loadProductsListServiceConfig, parseUrlToSearchOptions, loadCategoriesListServiceConfig } from '@wix/stores/services';
40
42
* import { ProductList } from '@wix/stores/components';
41
43
*
42
-
* // Define search options
43
-
* const searchOptions = {
44
-
* cursorPaging: { limit: 12 },
45
-
* filter: {},
46
-
* sort: [{ fieldName: 'name', order: 'ASC' }]
47
-
* };
44
+
* // Option 1: Load from URL (will parse filters, sort, pagination from URL params)
0 commit comments