Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: Alphabetically Sort Wishlist

  1. #1
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default Alphabetically Sort Wishlist

    Hey I'm trying to sort the wishlist alphabetically. In the wishlist.aspx.cs, the wishlist is populated by the following query:
    Code:
    SELECT ProductID, IsAKit, Quantity FROM ShoppingCart WHERE ShoppingCartRecID = {0}
    I tried to modify that query to this but it did not work:
    Code:
    SELECT sc.ProductID, sc.IsAKit, sc.Quantity from StoreFront.dbo.ShoppingCart sc JOIN StoreFront.dbo.Product p on p.ProductID = sc.ProductID WHERE ShoppingCartRecID = 169 ORDER BY p.Name;
    Can anybody see anything that I'm doing wrong? Appreciate all the help I can get. Thanks!

  2. #2
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    anybody that is good at sql?

  3. #3
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    Your SQL statement would only return 1 row because:
    Code:
    WHERE ShoppingCartRecID = 169
    So maybe it is working
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  4. #4
    sam.bengtson is offline Member
    Join Date
    Jan 2011
    Posts
    64

    Default

    yeah thats kind of where i'm stuck. I don't completely understand how it gets populated because it seems to only grab 1 item at a time which makes it impossible to sort

  5. #5
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    I don't use wishlists, so I'm not familiar with the code. But you seem to have identified the piece of code which is used if the customer wants to move one of the products in their wishlist to the basket. What you should be looking at is inside InitializePageContent()

    Code:
                String CartItemsXmlPackage = AppLogic.AppConfig("XmlPackage.WishListPageItems");
                if (CartItemsXmlPackage.Length != 0)
                {
                    CartItems.Text = AppLogic.RunXmlPackage(CartItemsXmlPackage, base.GetParser, ThisCustomer, SkinID, String.Empty, String.Empty, true, true);
                }
                else
                {
                    CartItems.Text = cart.DisplayItems(false, ThisCustomer, true) + "<br/>";
    
                    int ItemsInWishListNow = ShoppingCart.NumItems(ThisCustomer.CustomerID, CartTypeEnum.WishCart);
                    if (cart.CartType == CartTypeEnum.WishCart)
                    {
                        if (ThisCustomer != null && !ThisCustomer.IsRegistered && !AppLogic.AppConfigBool("DisallowAnonCustomerToCreateWishlist") && ItemsInWishListNow > 0)
                        {
                            lblWishlistMessage.Text = AppLogic.GetString("wishlist.aspx.4", SkinID, ThisCustomer.LocaleSetting);
                        }
                        else
                        {
                            lblWishlistMessage.Visible = false;
                        }
                    }
                }
    This seems to be saying if there isn't an XMLPackage (defined by the AppConfig 'XMLPackage.WishListPageItems' - presumably for a customised view) then use cart.DisplayItems() which means you'd need to customise that c# code to get it in a different order. Alternatively, create an XMLPackage which sorts in the correct order and change the AppConfig to tell it about your new package.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!