F.Y.I 1.80 now uses LINQ for this… So if you want to really control the featured products on the home page you will need to modify [NopSolutions.NopCommerce.BusinessLogic.Products]
My sample gets 6 random products for display on the home page.
/// <summary> /// Gets all products displayed on the home page /// </summary> /// <returns>Product collection</returns> public static List<Product> GetAllProductsDisplayedOnHomePage() { bool showHidden = NopContext.Current.IsAdmin;
int languageId = 0; if (NopContext.Current != null) languageId = NopContext.Current.WorkingLanguage.LanguageId;
var context = ObjectContextHelper.CurrentObjectContext;
//Modified code var query = (from p in context.Products orderby Guid.NewGuid() where (showHidden || p.Published) && !p.Deleted select p).Take(6);
var products = query.ToList();
return products;
//Old code //var query = from p in context.Products // orderby p.Name // where (showHidden || p.Published) && // !p.Deleted && // p.ShowOnHomePage // select p;
Could you give us information about how did you change the design and come up with this page. How did you started?
how did you change the master page and the template ? Another question is why is your website coming up so slow? is this the drawback of nopcommerce or the hosting company?
First the site is not slow.. (Based on performance test conducted using HP LoadRunner) not sure if you are using dialup or what but this thing is running on one of the new GoDaddy dedicated virtual servers, it’s as fast as it can be.
To answer your question there are some things you just have to know in general as to how nopcommerce actually works (Basic web development and Object Oriented Concepts in C#).
To start take a look at some of the available templates for nopcommerce and play around with them. Also be sure to download the source version of nopcommerce. Note: If you do not have C# programming and basic web development experience you might want to go take a class at your local community college.