Name of a product

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hello,
I am currently working on the "CustomerController" , in this method Im writting I need the name ( the title) of the product the current customer is visiting in the product details page , how can I get it in a string variable ?
7 years ago
Hi,

You should take a look at following lines of code in the ProductController class


[NopHttpsRequirement(SslRequirement.No)]
        public ActionResult RecentlyViewedProducts()
        {
            if (!_catalogSettings.RecentlyViewedProductsEnabled)
                return Content("");

            var products = _recentlyViewedProductsService.GetRecentlyViewedProducts(_catalogSettings.RecentlyViewedProductsNumber);

            var model = new List<ProductOverviewModel>();
            model.AddRange(PrepareProductOverviewModels(products));

            return View(model);
        }


Hope this help :)
7 years ago
Hello,
I tried this but I can't use it since it doens't give me the name of the current product the client is viewing , the recently viewed products list doesn't belong to a client in particuler so in return i get the latest viewed product instead of the current one
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.