質問

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