In Reports > Who's on Line, is there a way to get the product name instead of
/Product.aspx?ProductId=49&CategoryId=7
This is tough to decipher at the end of a long day.
Who's on line? Show product names?
Re: Who's on line? Show product names?
Try following trick edit your Admin/People/Users/ViewHistoryDialog.ascx.cs file and change GetUri(object dataItem) method as below
Code: Select all
protected string GetUri(object dataItem)
{
PageView pageView = (PageView)dataItem;
if(pageView.CatalogNodeType == CatalogNodeType.Product)
return pageView.CatalogNode.Name;
if (!string.IsNullOrEmpty(pageView.UriQuery))
{
if (pageView.UriQuery.Contains("ProductId"))
{
string uriQuery = pageView.UriQuery;
uriQuery = uriQuery.Replace("ProductId=",string.Empty);
int index = uriQuery.IndexOf("&");
int productId = 0;
if (index < 0)
productId = AlwaysConvert.ToInt(uriQuery);
else
{
string pid = uriQuery.Substring(0, index + 1);
productId = AlwaysConvert.ToInt(pid);
}
Product product = ProductDataSource.Load(productId);
if (product != null)
return product.Name;
}
return pageView.UriStem + "<wbr>?" + pageView.UriQuery.Replace("&", "<wbr>&").Replace("%", "<wbr>%");
}
else return pageView.UriStem;
}