HomeHome Product Discus... Product Discus...SmithCartSmithCartCategory Module shows incorrect countsCategory Module shows incorrect counts
Previous
 
Next
New Post
11/22/2013 4:29 AM
 
I'm using the SC Category Menu module on my catalog page. I have it configured to show the count of products in each category. The counts are incorrect. I have 3 total products in my store 2 Flow Meters and 1 Service. The Flow Meters category shows 6 items. I suspect this is counting Flow Meters product entries that I have deleted from the store. Is there something I need to do to "flush" these products so the counts are correct?

I'm running SC 5.68 on DNN 7.1.1. Here are the relevant screen shots.










 
New Post
11/25/2013 4:21 PM
 
Hi Tom,

I have been successful in replicating the behavior you are reporting.

To resolve the issue navigate to the following stored procedure in SQL. Then copy and  paste the following  the following script below the dashed line in the stored procedure:

Smith_ListCategoryMenuCount


ALTER PROCEDURE [dbo].[dnn_Smith_ListCategoryMenuCount]

      @TabModuleId int

AS

select

      CategoryID,

      CategoryName + ' (' + cast( (

                                                      --select count(*) FROM dnn_Smith_CategoryProduct cp

                                                      select count(*) FROM dnn_Smith_CategoryProduct cp

                                                      join dnn_Smith_Products p

                                                      on cp.ProductID = p.ProductID

                                                      WHERE cp.categoryid=c.CategoryID and p.LogicallyDeleted != 1 AND p.Archived != 1 

                                                      ) as varchar)  + ')' as 'CategoryName',

     

      --Create ChildNodeCount field

      (select count(*) FROM dnn_Smith_Category sc

      WHERE parentid=sc.CategoryID) as 'childnodecount'

FROM dnn_Smith_Category c

where parentID = 0 and ( TabModuleId = @TabModuleId  OR Share = 1)

ORDER BY SortOrder




Please Note: You will need to remove the dnn_ prefix if you are not using an object qualifier

Please let me know if you have any additional question or concerns. Thanks!
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartCategory Module shows incorrect countsCategory Module shows incorrect counts