문제

I want to display 10 most viewed product in category page i was made insert method for that in

nopCommerce_3.20_Source\Libraries\Nop.Services\Catalog\ProductService.cs

public virtual void InsertMostViewProduct(MostViewProduct product)
{
        if (product == null)
           throw new ArgumentNullException("product");
        //insert
        _mostviewRepository.Insert(product);

        //clear cache
        _cacheManager.RemoveByPattern(PRODUCTS_PATTERN_KEY);

        //event notification
        _eventPublisher.EntityInserted(product);

}

My question is that how should i call this method when i click on product and that entry save in database?

Please advise.

도움이 되었습니까?

해결책

I tracked your first question about displaying 10 most viewed product.

you have to add this functionality to the product service and in the catalog controller of the Nop.Web project you have to add called the newly created method in the product service in the Product Action

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top