Difference between revisions of "Code for Alert when there are reviews to approve"

From AbleCommerce Wiki
Jump to: navigation, search
(New page: 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 ...)
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
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
 
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  
+
<code> //UPDATE CACHE </code>
  
 
Here is the code
 
Here is the code
  
 +
<code><pre>
 
             if (store.Settings.ProductReviewEnabled != CommerceBuilder.Users.UserAuthFilter.None)
 
             if (store.Settings.ProductReviewEnabled != CommerceBuilder.Users.UserAuthFilter.None)
 
             {
 
             {
Line 16: Line 17:
 
                 }
 
                 }
 
             }
 
             }
 +
</pre></code>
 +
 +
==Reference==
 +
Originally posted in forums by compunerdy http://forums.ablecommerce.com/viewtopic.php?f=47&t=6393
 +
 +
[[Category:AbleCommerce 7]]

Latest revision as of 11:08, 15 August 2013

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));   
                }
            }

Reference

Originally posted in forums by compunerdy http://forums.ablecommerce.com/viewtopic.php?f=47&t=6393