docs
  1. Changelogs
  2. Storefront SDKs
  3. @scayle/storefront-product-listing

@scayle/storefront-product-listing

2.1.0

Minor Changes

  • Added support for custom filter prefix for filter utility functions.
    Following functions now accept a filterPrefix parameter that can be used to customize the filter prefix.
    • parseFilterDataFromRoute
    • createNewAttributeQuery
    • createNewPriceQuery
    • createNewReductionQuery
    • createNewBoolAttributeQuery
    • getClearedPriceQuery
    • getClearedReductionQuery
    • getClearedFilterQueryByKey
    • buildQueryFromCategoryFilters

2.0.2

Patch Changes

  • Refined useAppliedFilters to update the appliedFilter value only when query parameters beginning with the specified filtersPrefix change, preventing unnecessary updates of appliedFilter when unrelated query parameters are modified
    Before:
    Any change to query parameters, regardless of their name, such as ?someQueryParam=true, would trigger a reactive update of appliedFilter.
    After:
    Only changes to query parameters that begin with the specified prefix (e.g., filters) will trigger an update. For example, only ?filters[someQueryParam]=true will cause appliedFilter to update, while unrelated query parameters will be ignored.

2.0.1

Patch Changes

  • Resolved an issue where the appliedFilter in useAppliedFilters was updated on every route change even if the query didn't change.
    This caused unnecessary updates in places where there is a reactive dependency on the appliedFilter. The appliedFilter is now only updated when the query actually changes.

2.0.0

Major Changes

  • BREAKING: Removed the defaultSortingOptions export. It is now expected to explicitly pass the sortingOptions to useProductListSort.
    Before

    (Both before approaches are equivalent.)
    After
  • BREAKING: useProductListingSeoData now expects isDefaultSortSelected to be passed as the final parameter. This removes the internal dependency on useProductListSort. It is typed as MaybeRefOrGetter<Boolean> to support reactive usage.
    Before

    After

Minor Changes

  • Added exports for individual sort configs. SORT_TOP_SELLER, SORT_DATE_NEWEST, SORT_PRICE_DESC, SORT_PRICE_ASC, and SORT_REDUCTION_DESC. These can be used to easily construct a list of sort configs to pass to useProductListSort.
  • Added new type exports SelectedSort and SortLink. This improves the experience of using useProductListSort by making the parameter and return types of this composable more accessible.
  • The sortingKey for the default Topseller sort has changed from scayle:v1:recommended to scayle:v1:balanced-offerings.

Patch Changes

  • In useProductListSort, the sortingOptions option now accepts MaybeRefOrGetter<SelectedSort[]>. This allows for reactive usage of the composable.

1.8.1

Patch Changes

  • Corrected import from @scayle/storefront-core to @scayle/storefront-nuxt.

1.8.0

Minor Changes

  • Enhanced useAppliedFilters to support the minReduction and maxReduction filter names, enabling proper handling of the max_savings_percentage filter.

1.7.0

Minor Changes

  • Export defaultSortingOptions and DEFAULT_SORTING_KEY from the useProductListSort composable. This change enhances consumer flexibility, allowing for more granular adjustments to custom sorting options.

1.6.3

Patch Changes

  • Validate the id parameter passed to getAllShopCategoriesForId before calling Storefront API. This ensures that we will not send a useless request to Storefront API when we know the id is invalid.

1.6.2

Patch Changes

  • Renamed useAllShopProductsById to useAllShopProductsForId to match the correct method name.
  • Fixed path resolution issue for RPC methods.

1.6.1

Patch Changes

  • Added missing exports for useAllShopCategoriesForId composable and SEO utils.

1.6.0

Minor Changes

  • [PLP] Added generateCategoryHreflangLinks utils to generate hreflang links for a category for all shops.
  • [PLP] Added RPC method getAllShopCategoriesForId and the composable useAllShopCategoriesForId for product listing page to fetch category for all shops. This is used to generate hreflang links for the category for all shops.

1.5.0

Minor Changes

  • [Utilities] Added getCategoryAncestors, isSaleCategory, and flattenCategoryTree utilities to enhance functionality.

1.4.0

Minor Changes

  • Update to @nuxt/module-builder@1. This version of Nuxt Module Builder is ESM-only, so CommonJS (.cjs) files will no longer be built or distributed with the package. However as of Nuxt 3, only esm is used so this should not have any impact as this module does not support Nuxt 2.

1.3.2

Patch Changes

  • Use absolute URL's in category breadcrumbs JSONLD returned by useProductListingSeoData

1.3.1

Patch Changes

  • Added vue@>=3.5.13 to peerDependencies.

1.3.0

Minor Changes

  • Add buildQueryFromCategoryFilters utility.

1.2.0

Minor Changes

  • Update APISortOrder and APISortOption names due to update to newest @scayle/storefront-nuxt version.

1.1.3

Patch Changes

  • Ensure the module meta has the correct package version

1.1.2

Patch Changes

  • Update useFiltersForListing to automatically refresh filter data whenever the its parameter change. This will ensure filteredProductCount is up to date.

1.1.1

Patch Changes

1.1.0

Minor Changes

  • Updates the parameter type of useFiltersForListing from MaybeRefOrGetter to Ref to enforce that the parameter is a mandatory reactive reference. Non-reactive parameter will not work as expected in the Boilerplate.
  • Updates the parameter type of useProductsForListing from MaybeRefOrGetter to Ref to enforce that the parameter is a mandatory reactive reference. Non-reactive parameter will not work as expected in the Boilerplate.

1.0.0

Major Changes

  • This release introduces the @scayle/storefront-product-listing package, decoupling composables and utilities of the Product Listing Page (PLP) functionality from the SCAYLE Storefront Boilerplate for enhanced modularity and integration. This separation empowers developers with greater control over PLP updates and simplifies its integration into existing Storefront-based projects.
  • This release requires @scayle/[email protected] or higher. Support for @scayle/[email protected] has been discontinued. Please update your dependencies accordingly. The peerDependency range has been updated to ^8.0.0.

Minor Changes

  • Compared to the original implementation within the SCAYLE Storefront Boilerplate, the @scayle/storefront-product-detail package has received some improvements and refactoring:
    • The useAppliedFilters composable has been added to the storefront-product-listing package. It now accepts a filtersPrefix parameter, allowing you to specify a custom prefix for filter-related query parameters.
    • The useProductListSort composable has been added to the storefront-product-listing package. It now accepts a sortingOptions and defaultSortingKey parameter, to config the sorting options and set the initial sorting value.
    • The useProductListFilter composable has been added to the storefront-product-listing package. It accepts currentCategoryId, which represents the active category, and ProductListFilterOptions for specifying options for the underlying useFilters composable.
    • The filters utility has been added to the storefront-product-listing package. It provides utilities for filter query manipulation.
    • All exports are now defined in a single file, and everything is exposed via the #storefront-product-listing import.
    • The useProductsByCategory composable has been added to the storefront-product-listing package. It now accepts a categoryId and ProductsByCategoryOptions object that has certain fetching products by category params(category & categoryId), fetchingOptions, productsPerPage, fetchProductsCacheTtl, cacheKeyPrefix, fetchingKey, withParams (for product) and query (current route query state).
    • The useProductListingSeoData composable has been added to the storefront-product-listing package. It accepts reactive category, breadcrumbs, an object of type UrlParams (containing a baseUrl and fullPath) which are used for building SEO data.
    • Product Listing-related test factories are now exposed externally. They can be used as follows:
    • Upgrade the storefront-core and storefront-nuxt packages to version 8 and update your implementation to reflect the changes in RPC composables:
      • The composables useProductListFilter and useProductsByCategory now return a status property instead of fetching. The status can have one of the following values: idle, pending, error, or success.
      • The fetch method has been replaced by refresh. Update your logic accordingly to use the new method.

0.6.0

Minor Changes

  • Renamed the composables useProductListFilter to useFiltersForListing.
  • Composable useProductListFilter now allows configuration of the parameters includeSellableForFree, includeSoldOut, orFiltersOperator.
  • Removes the internal call to useAppliedFilters and useProductListSort which need to be explicitly passed to useProductsForListing and useFiltersForListing
  • Renamed the composables useProductsByCategory to useProductsForListing.
  • The configurable caching options cacheKeyPrefix and fetchProductsCacheTtl have been removed from the useProductsByCategory composable.
  • Removed unnecessary parameter category and return value activeCategoryName from useProductListingSeoData.
  • The productsPerPage parameter in the useProductsByCategory composable is now required and no longer provides a default value.
  • Removed the getClearedPriceQuery utility function. Price filter resetting can now be achieved via the getClearedFilterQueryByKey function.

0.5.0

Minor Changes

  • Allow Storefront Nuxt v8 as a peer dependency

0.4.2

Patch Changes

  • The useProductsByCategory composable now sets the trackSearchAnalyticsEvent parameter by default if the current page evaluates to 1 and the appliedFilter.term is not empty. The default behavior can be overridden by passing trackSearchAnalyticsEvent: false as part of ProductsByCategoryOptions.params. For more details, check the SCAYLE Search Analytics section in the SCAYLE Resource Center.

0.4.1

Patch Changes

  • Resolved an issue where the default parameter values for useProductsByCategory like productsPerPage or cacheKeyPrefix were not being set correctly.

0.4.0

Minor Changes

  • Fix computed sortLinks return type mismatch in UseProductListSortReturn interface.

0.3.0

Minor Changes

  • Fix sortLinks type by extending the SelectedSort type with to property which represents the RouteLocationRaw type from vue-router.

0.2.0

Minor Changes

  • Add and expose externally explicit return types/interfaces for all product listing composables.

0.1.4

Patch Changes

  • Resolved reactivity issues in composables by ensuring they receive the full route object instead of just the query object. This allows for more reliable updates when the route changes.

0.1.3

Patch Changes

  • Resolve an issue where sortLinks in useProductListSort caused broken URLs on the PLP. The sortLinks now include a path attribute reflecting the current route path.

0.1.2

Patch Changes

  • Update import of test factories to use new entry point

0.1.1

Patch Changes

  • Resolved issue where sorting did not correctly route to the first page.

0.1.0

Minor Changes

  • Introduce @scayle/storefront-product-listing package