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 “MasterClassPartialViewController” 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 the categories recursively by adding sub categories into the model as well using CatalogLibrary to find the children.

Add link to the categoryViewModel.Url that points to
‘/category?category=categoryId’


Bonus

Try assigning domains to each of the root nodes in Umbraco.

Create a new store, assign different domains to each of the stores. Set up a new catalog and new categories under the store as well.

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/catalogfoundation/catalog-structure.html

{{lineitem.ProductName}}

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

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