Hi
I want to develop a plugin which analyzes customer behavior. Specifically I need to detect when the customers are on a category view page, and when they are on a product view page. Is there any way we can detect that?
int productId = 0;
if (Url.RequestContext.RouteData.Values.Keys.Contains("productid"))
{
int.TryParse(Url.RequestContext.RouteData.Values["productid"].ToString(), out productId);
}
int categoryId = 0;
if (Url.RequestContext.RouteData.Values.Keys.Contains("categoryId"))
{
int.TryParse(Url.RequestContext.RouteData.Values["categoryId"].ToString(), out categoryId);
}