@inherits ViewModelTemplate<ProductListViewModel>
@using Dynamicweb.Rendering
@using Dynamicweb.Ecommerce.ProductCatalog

@{
	if (Dynamicweb.Context.Current?.Items.Contains("ProductList") ?? false)
	{
		Dynamicweb.Context.Current.Items["ProductList"] = Model;
	}
	else
	{
		Dynamicweb.Context.Current?.Items.Add("ProductList", Model);
	}
	var shopPage = GetPageIdByNavigationTag("ProductListPage");
}

@RenderGrid(Dynamicweb.Content.Services.Pages.GetPagesByParentID(Pageview.ID).FirstOrDefault(p => p.ItemType.Equals("Swift-v2_ProductList", StringComparison.OrdinalIgnoreCase))?.ID ?? shopPage)
