in

dashCommerce

An ASP.NET Open Source e-Commerce Application

Widget Adjustments?

Last post 07-08-2008 12:13 PM by esantiago13. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 07-07-2008 3:08 PM

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Widget Adjustments?

    How/where would one go about adjusting the widgets? I'd rather only see three (3) Favorite Products and Favorite Categories, and can't find where that is determined....

    --
    Bruce
    Filed under:
  • 07-08-2008 12:33 AM In reply to

    Re: Widget Adjustments?

    Execute this in your DB

    ALTER PROCEDURE [dbo].[dashCommerce_Store_FetchFavoriteProducts]

    @UserName nvarchar(50),

    @BrowsingBehaviorId int

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    SELECT TOP 3

    v.ProductId

    ,v.[Name]

    ,COUNT(dashCommerce_Store_Browsing_Log.BrowsingLogId) AS ViewCount

    FROM dashCommerce_Store_Browsing_Log

    INNER JOIN vw_dashCommerce_NotInActiveAndLocked_Products v

    ON dashCommerce_Store_Browsing_Log.RelevantId = v.ProductId

    WHERE dashCommerce_Store_Browsing_Log.UserName = @UserName

    AND dashCommerce_Store_Browsing_Log.BrowsingBehaviorId = @BrowsingBehaviorId

    GROUP BY

    v.ProductId

    ,v.[Name]

    ORDER BY ViewCount DESC

    END

    ALTER PROCEDURE [dbo].[dashCommerce_Store_FetchFavoriteCategories]

    -- Add the parameters for the stored procedure here

    @UserName nvarchar(50),

    @BrowsingBehaviorId int

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    -- Insert statements for procedure here

    SELECT TOP 3

    dbo.dashCommerce_Store_Category.CategoryId

    ,dbo.dashCommerce_Store_Category.[Name]

    ,COUNT(dbo.dashCommerce_Store_Browsing_Log.BrowsingLogId) AS ViewCount

    FROM dbo.dashCommerce_Store_Browsing_Log

    INNER JOIN dbo.dashCommerce_Store_Category

    ON dbo.dashCommerce_Store_Browsing_Log.RelevantId = dbo.dashCommerce_Store_Category.CategoryId

    WHERE dashCommerce_Store_Browsing_Log.UserName = @UserName

    AND dashCommerce_Store_Browsing_Log.BrowsingBehaviorId = @BrowsingBehaviorId

    GROUP BY

    dbo.dashCommerce_Store_Category.CategoryId

    ,dbo.dashCommerce_Store_Category.[Name]

    ORDER BY ViewCount DESC

    END

    ~Paul
  • 07-08-2008 12:33 AM In reply to

    Re: Widget Adjustments?

    Execute this in your DB

    ALTER PROCEDURE [dbo].[dashCommerce_Store_FetchFavoriteProducts]

    @UserName nvarchar(50),

    @BrowsingBehaviorId int

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    SELECT TOP 3

    v.ProductId

    ,v.[Name]

    ,COUNT(dashCommerce_Store_Browsing_Log.BrowsingLogId) AS ViewCount

    FROM dashCommerce_Store_Browsing_Log

    INNER JOIN vw_dashCommerce_NotInActiveAndLocked_Products v

    ON dashCommerce_Store_Browsing_Log.RelevantId = v.ProductId

    WHERE dashCommerce_Store_Browsing_Log.UserName = @UserName

    AND dashCommerce_Store_Browsing_Log.BrowsingBehaviorId = @BrowsingBehaviorId

    GROUP BY

    v.ProductId

    ,v.[Name]

    ORDER BY ViewCount DESC

    END

    ALTER PROCEDURE [dbo].[dashCommerce_Store_FetchFavoriteCategories]

    -- Add the parameters for the stored procedure here

    @UserName nvarchar(50),

    @BrowsingBehaviorId int

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    -- Insert statements for procedure here

    SELECT TOP 3

    dbo.dashCommerce_Store_Category.CategoryId

    ,dbo.dashCommerce_Store_Category.[Name]

    ,COUNT(dbo.dashCommerce_Store_Browsing_Log.BrowsingLogId) AS ViewCount

    FROM dbo.dashCommerce_Store_Browsing_Log

    INNER JOIN dbo.dashCommerce_Store_Category

    ON dbo.dashCommerce_Store_Browsing_Log.RelevantId = dbo.dashCommerce_Store_Category.CategoryId

    WHERE dashCommerce_Store_Browsing_Log.UserName = @UserName

    AND dashCommerce_Store_Browsing_Log.BrowsingBehaviorId = @BrowsingBehaviorId

    GROUP BY

    dbo.dashCommerce_Store_Category.CategoryId

    ,dbo.dashCommerce_Store_Category.[Name]

    ORDER BY ViewCount DESC

    END

    ~Paul
  • 07-08-2008 1:02 AM In reply to

    Re: Widget Adjustments?

    Hello, I tried to execute in my database and I'm getting this error.

    Msg 156, Level 15, State 1, Procedure , Line 36

    Incorrect syntax near the keyword 'PROCEDURE'.

    I'm looking at the database and there is no table called "dbo.dashCommerce_Store_FetchFavoriteProducts".

    This is the line that the error is mentioning "ALTER PROCEDURE [dbo].[dashCommerce_Store_FetchFavoriteCategories]"

    am I missing something...

  • 07-08-2008 1:15 AM In reply to

    Re: Widget Adjustments?

    It is not a table, it is a stored procedure.

    try adding this to the beggining of what I sent.

    USE yourdatabasenamehere

    ~Paul
  • 07-08-2008 1:46 AM In reply to

    Re: Widget Adjustments?

    ok stupid me... Sorry about that I should have known better. So I did what you said and got these errors.

    Msg 111, Level 15, State 1, Procedure dashCommerce_Store_FetchFavoriteProducts, Line 17

    'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.

    Msg 156, Level 15, State 1, Procedure dashCommerce_Store_FetchFavoriteProducts, Line 38

    Incorrect syntax near the keyword 'PROCEDURE'.

     Line 17 is this "SELECT TOP 3 " and line 38 is this "ALTER PROCEDURE [dbo].[dashCommerce_Store_FetchFavoriteCategories]"

  • 07-08-2008 10:11 AM In reply to

    Re: Widget Adjustments?

    Answer

    This will be easiar.

    Go into your database.

    Do this for each of the 2 sprocs (FetchFavoriteCategories and FetchFavoriteProducts).

    Right click the sproc in click modify. Find SELECT TOP 5 and replace the 5 with 3.

    Press the execute button in the top toolbar.

    ~Paul
  • 07-08-2008 10:31 AM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Widget Adjustments?

    Thanks very much, Paul... now all I have to do is find WHERE these stored procedures ARE in SQL Server Management Studio Express!!!

     

    --
    Bruce
  • 07-08-2008 10:36 AM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Widget Adjustments?

    P.S. I found 'em!!!   Cool -- and your solution worked perfectly! Thanks again, Paul!

    --
    Bruce
  • 07-08-2008 12:13 PM In reply to

    Re: Widget Adjustments?

    theonlylawislove:

    This will be easiar.

    Go into your database.

    Do this for each of the 2 sprocs (FetchFavoriteCategories and FetchFavoriteProducts).

    Right click the sproc in click modify. Find SELECT TOP 5 and replace the 5 with 3.

    Press the execute button in the top toolbar.

     

    Yes that was much easier to do. Thanks very much.Yes

Page 1 of 1 (10 items)