Class ProductListViewModelExtensions
- Namespace
- Dynamicweb.Ecommerce.ProductCatalog
- Assembly
- Dynamicweb.Ecommerce.dll
Extension methods for the ProductListViewModel class.
public static class ProductListViewModelExtensions
- Inheritance
-
ProductListViewModelExtensions
- Inherited Members
Methods
GetSubOrRootGroups(ProductListViewModel)
Retrieves product sub-groups if they exist, otherwise selects groups based on ecommerce navigation configuration of the current page.
This method follows these steps sequentially:
- If sub-groups are already present in the view model, they are immediately returned.
- If no sub-groups are available, it proceeds with selecting groups according to the following logic:
- If specific groups are provided in the ecommerce navigation settngs, those groups are returned.
- If specific shop is provided in the ecommerce navigation settngs, the top-level groups of that shop are returned.
- If none of the above conditions applies, an empty collection is returned.
public static IEnumerable<ProductGroupViewModel> GetSubOrRootGroups(this ProductListViewModel model)
Parameters
modelProductListViewModelThe product list view model.
Returns
- IEnumerable<ProductGroupViewModel>
A collection of either sub-groups or top-level shop groups depending on the navigation configuration of the current page.
GetUriWithoutSelectedFacets(ProductListViewModel)
Gets the URI of the current page without the querystring parts of the selected facets. The returned URL can be used as a direct link to clear all selected facets of the search result. The returned URL can be used as action on the facet form that when submitted will only apply the new selection of facets
public static Uri GetUriWithoutSelectedFacets(this ProductListViewModel model)
Parameters
modelProductListViewModelThe product list view model.
Returns
- Uri
The URI without the selected facets.