Code for Alert when there are reviews to approve

From AbleCommerce Wiki
Revision as of 16:27, 13 August 2008 by Mazhar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

You can modify the Admin/Dashboard/AdminAlerts.ascx to do this job. Place the code given below just beneath the following line in the file

//UPDATE CACHE

Here is the code

           if (store.Settings.ProductReviewEnabled != CommerceBuilder.Users.UserAuthFilter.None)
           {
               ProductReviewCollection unaprovedReviews = 
               ProductReviewDataSource.LoadUnApprovedReviews();
               if (unaprovedReviews.Count > 0)
               {
                   string alertText = "You have ({0}) unaproved review{1}.";
                   string tempValue = (unaprovedReviews.Count > 1) ? "s" : string.Empty;
                   alertList.Add(string.Format(alertText, unaprovedReviews.Count,tempValue));   
               }
           }