Tushar Tushar - 1 year ago 181
C# Question

How to get product view count in NopCommerce?

I am using NopCommerce. I want to find top 10 most viewed products of particular category.

For that I have created new table named

. I want to join "Product" table with this table to store product view count.

So, how can I get the number ff views for particular product?

Answer Source

You would need to write logic for increasing product view count at following action

public ActionResult Product(int productId)

In service you need to write actual logic to increase view count

 public virtual void IncreaseViewCount(int pId)
  //here get entry for product view details if exists or create new one
  //then increase count by 1
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download