@scayle/storefront-product-listing
2.1.1
Patch Changes
- Use latest
[email protected]for build. Compatibility with previous version has not changed and is specified via packagepeerDependenciesand Nuxtcompatibilityflag.
2.1.0
Minor Changes
- Added support for custom filter prefix for filter utility functions.
Following functions now accept afilterPrefixparameter that can be used to customize the filter prefix.parseFilterDataFromRoutecreateNewAttributeQuerycreateNewPriceQuerycreateNewReductionQuerycreateNewBoolAttributeQuerygetClearedPriceQuerygetClearedReductionQuerygetClearedFilterQueryByKeybuildQueryFromCategoryFilters
2.0.2
Patch Changes
- Refined
useAppliedFiltersto update theappliedFiltervalue only when query parameters beginning with the specifiedfiltersPrefixchange, preventing unnecessary updates ofappliedFilterwhen unrelated query parameters are modified
Before:
Any change to query parameters, regardless of their name, such as?someQueryParam=true, would trigger a reactive update ofappliedFilter.
After:
Only changes to query parameters that begin with the specified prefix (e.g.,filters) will trigger an update. For example, only?filters[someQueryParam]=truewill causeappliedFilterto update, while unrelated query parameters will be ignored.
2.0.1
Patch Changes
- Resolved an issue where the
appliedFilterinuseAppliedFilterswas 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 theappliedFilter. TheappliedFilteris now only updated when the query actually changes.
2.0.0
Major Changes
- BREAKING: Removed the
defaultSortingOptionsexport. It is now expected to explicitly pass thesortingOptionstouseProductListSort.
Before
(Both before approaches are equivalent.)
After - BREAKING:
useProductListingSeoDatanow expectsisDefaultSortSelectedto be passed as the final parameter. This removes the internal dependency onuseProductListSort. It is typed asMaybeRefOrGetter<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, andSORT_REDUCTION_DESC. These can be used to easily construct a list of sort configs to pass touseProductListSort. - Added new type exports
SelectedSortandSortLink. This improves the experience of usinguseProductListSortby making the parameter and return types of this composable more accessible. - The
sortingKeyfor the default Topseller sort has changed fromscayle:v1:recommendedtoscayle:v1:balanced-offerings.
Patch Changes
- In
useProductListSort, thesortingOptionsoption now acceptsMaybeRefOrGetter<SelectedSort[]>. This allows for reactive usage of the composable.
1.8.1
Patch Changes
- Corrected import from
@scayle/storefront-coreto@scayle/storefront-nuxt.
1.8.0
Minor Changes
- Enhanced
useAppliedFiltersto support theminReductionandmaxReductionfilter names, enabling proper handling of themax_savings_percentagefilter.
1.7.0
Minor Changes
- Export
defaultSortingOptionsandDEFAULT_SORTING_KEYfrom theuseProductListSortcomposable. This change enhances consumer flexibility, allowing for more granular adjustments to custom sorting options.
1.6.3
Patch Changes
- Validate the
idparameter passed togetAllShopCategoriesForIdbefore calling Storefront API. This ensures that we will not send a useless request to Storefront API when we know theidis invalid.
1.6.2
Patch Changes
- Renamed
useAllShopProductsByIdtouseAllShopProductsForIdto match the correct method name. - Fixed path resolution issue for RPC methods.
1.6.1
Patch Changes
- Added missing exports for
useAllShopCategoriesForIdcomposable and SEO utils.
1.6.0
Minor Changes
- [PLP] Added
generateCategoryHreflangLinksutils to generate hreflang links for a category for all shops. - [PLP] Added RPC method
getAllShopCategoriesForIdand the composableuseAllShopCategoriesForIdfor 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, andflattenCategoryTreeutilities 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.13topeerDependencies.
1.3.0
Minor Changes
- Add
buildQueryFromCategoryFiltersutility.
1.2.0
Minor Changes
- Update
APISortOrderandAPISortOptionnames due to update to newest@scayle/storefront-nuxtversion.
1.1.3
Patch Changes
- Ensure the module meta has the correct package version
1.1.2
Patch Changes
- Update
useFiltersForListingto automatically refresh filter data whenever the its parameter change. This will ensurefilteredProductCountis up to date.
1.1.1
Patch Changes
- We've updated to
[email protected]
1.1.0
Minor Changes
- Updates the parameter type of
useFiltersForListingfromMaybeRefOrGettertoRefto 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
useProductsForListingfromMaybeRefOrGettertoRefto 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-listingpackage, 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. ThepeerDependencyrange has been updated to^8.0.0.
Minor Changes
- Compared to the original implementation within the SCAYLE Storefront Boilerplate, the
@scayle/storefront-product-detailpackage has received some improvements and refactoring:- The
useAppliedFilterscomposable has been added to thestorefront-product-listingpackage. It now accepts afiltersPrefixparameter, allowing you to specify a custom prefix for filter-related query parameters. - The
useProductListSortcomposable has been added to thestorefront-product-listingpackage. It now accepts asortingOptionsanddefaultSortingKeyparameter, to config the sorting options and set the initial sorting value. - The
useProductListFiltercomposable has been added to thestorefront-product-listingpackage. It acceptscurrentCategoryId, which represents the active category, andProductListFilterOptionsfor specifying options for the underlyinguseFilterscomposable. - The
filtersutility has been added to thestorefront-product-listingpackage. It provides utilities for filter query manipulation. - All exports are now defined in a single file, and everything is exposed via the
#storefront-product-listingimport. - The
useProductsByCategorycomposable has been added to thestorefront-product-listingpackage. It now accepts acategoryIdandProductsByCategoryOptionsobject that has certain fetching products by category params(category&categoryId),fetchingOptions,productsPerPage,fetchProductsCacheTtl,cacheKeyPrefix,fetchingKey,withParams(for product) andquery(current route query state). - The
useProductListingSeoDatacomposable has been added to thestorefront-product-listingpackage. It accepts reactivecategory,breadcrumbs, an object of typeUrlParams(containing abaseUrlandfullPath) 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-coreandstorefront-nuxtpackages to version 8 and update your implementation to reflect the changes in RPC composables:- The composables
useProductListFilteranduseProductsByCategorynow return astatusproperty instead offetching. Thestatuscan have one of the following values:idle,pending,error, orsuccess. - The
fetchmethod has been replaced byrefresh. Update your logic accordingly to use the new method.
- The composables
- The
0.6.0
Minor Changes
- Renamed the composables
useProductListFiltertouseFiltersForListing. - Composable
useProductListFilternow allows configuration of the parametersincludeSellableForFree,includeSoldOut,orFiltersOperator. - Removes the internal call to
useAppliedFiltersanduseProductListSortwhich need to be explicitly passed touseProductsForListinganduseFiltersForListing - Renamed the composables
useProductsByCategorytouseProductsForListing. - The configurable caching options
cacheKeyPrefixandfetchProductsCacheTtlhave been removed from theuseProductsByCategorycomposable. - Removed unnecessary parameter
categoryand return valueactiveCategoryNamefromuseProductListingSeoData. - The
productsPerPageparameter in theuseProductsByCategorycomposable is now required and no longer provides a default value. - Removed the
getClearedPriceQueryutility function. Price filter resetting can now be achieved via thegetClearedFilterQueryByKeyfunction.
0.5.0
Minor Changes
- Allow Storefront Nuxt v8 as a peer dependency
0.4.2
Patch Changes
- The
useProductsByCategorycomposable now sets the trackSearchAnalyticsEvent parameter by default if the current page evaluates to1and theappliedFilter.termis not empty. The default behavior can be overridden by passingtrackSearchAnalyticsEvent: falseas part ofProductsByCategoryOptions.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
useProductsByCategorylikeproductsPerPageorcacheKeyPrefixwere not being set correctly.
0.4.0
Minor Changes
- Fix computed
sortLinksreturn type mismatch inUseProductListSortReturninterface.
0.3.0
Minor Changes
- Fix
sortLinkstype by extending theSelectedSorttype withtoproperty which represents theRouteLocationRawtype fromvue-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
routeobject instead of just thequeryobject. This allows for more reliable updates when the route changes.
0.1.3
Patch Changes
- Resolve an issue where
sortLinksinuseProductListSortcaused broken URLs on the PLP. ThesortLinksnow include apathattribute 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-listingpackage