Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all ,
How i prepare category list using razor in Ucommerce.
Thanks.
These methods will be useful:
Category.GetRootCategories(catalog);
Category.GetCategoriesForCategory(category);
With those in hand you loop over the returned categories and prepare the HTML you want:
@{ var catalog = ProductCatalog.SingleOrDefault(x => x.Name == SiteContext.Current.CatalogContext.GetCurrentCatalogName && x.ProductCatalogGroup == SiteContext.Current.CatalogContext.GetCurrentCatalogGroup);}@foreach(var category in Category.GetRootCategories(catalog)){ <h1> @category.Name </h1> }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Category List
Hi all ,
How i prepare category list using razor in Ucommerce.
Thanks.
These methods will be useful:
Category.GetRootCategories(catalog);
Category.GetCategoriesForCategory(category);
With those in hand you loop over the returned categories and prepare the HTML you want:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion