items qty sold

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
hi
can i show how many item's has been sold on product page? or in products on front page ?
thanks
4 years ago
I don't think NopCommerce has features to support this out of the box.
For achieving this, you will need to extend the product model(eg: new property with the name TotalSales) which needs to be assigned with the sum of quantities from the OrderItem table (you may want to check the order status too from the Order table to ensure that only the sold products are counted)
4 years ago
Thanks brother
Ok what should I do. How I can create tool do this feture.
Thanks
4 years ago
You can achieve this in two ways. For this programming knowledge and experience with .Net technologies is a must.
1) You can either modify the source code and add the properties to the product model, map the newly added properties with the order item's quantity sum in the model's preparation method and use the property in the view and display the result.
2) You can develop a widget plugin and implement a similar mechanism. The advantage of implementing the feature with the plugin is that we can easily upgrade the version of NopCommerce when the newer version of NopCommerce is released by simply upgrading the plugin along with following the upgrade guide for the version upgrade.
4 years ago
RE  "sum of quantities from the OrderItem table"
That can be an expensive operation - for each product on page(s).
You may want to consider some type of 'caching'  - e.g. a separate table that is populated nightly.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.