Browse - Category Navigation

Build a category listing for overall navigation of your store. You will gain knowledge of APIs relevant to loading categories and their related information along with an overall understanding of how to navigate the catalog structure.

 


Relevant APIs

 

 

UCommerce.Api
CatalogLibrary.GetRootCategories(ProductCatalog)
CatalogLibrary.GetCategories(Category)
CatalogLibrary.GetNiceUrlForCategory() (optional)
UCommerce.Extensions
CategoryExtensions.DisplayName()

Hands-on

Find the “PartialViewController” under the Controllers folder in the website project. The Method CategoryNavigation() Renders the actionview “categoryNavigation.cshtml” as requested with the following line in “Layout.cshtml”.

@{ Html.RenderAction("CategoryNavigation", "PartialView"); }

Find categories and sub categories using the CatalogLibrary and map them into the categorNavigationViewModel.Categories list. Map categories recursively. Add link to the categoryViewModel.Url that points to ‘/store/category?category=categoryId’

 


Bonus

Try setting up a new site by modifying Sites.masterclass.config adding a new site under the sites node. Create the matching content node in Sitecore. Create a new store, assign a domain to the new site. Set up a new catalog and new categories

Visit the new site. Does the category navigation change?


More information can be found on the documentation site:

http://docs.ucommerce.net/ucommerce/v6.8/getting-started/catalog-foundation/catalog-structure.html

 

 

{{lineitem.ProductName}}

{{lineitem.VariantName}} - {{lineitem.Quantity}} x {{lineitem.FormattedPrice}} {{lineitem.FormattedPrice}}

Your cart is empty ;(
Total {{basket.FormattedProductsTotal}}
Checkout