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 4 of 4

Thread: Gift Registry search issue

  1. #1
    llong is offline Member
    Join Date
    Dec 2008
    Posts
    30

    Default Gift Registry search issue

    I'm experiencing limited functionality with the gift registry search function. It appears the search by name function is returning only the first match which is leading to visitor confusion. IE a search for "Jen" will return "Jennifer Abbey" but not "Jenny Smith" - both are confirmed to have public registries.

    ASPDNSF: 8012
    IIS:7
    MsSQL:2005

    Follow up, has the gift registry been updated much in V9?

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    As far as I am aware, there were no changes with the giftregistry functionalities in v9.x, no. If the gift registry of "Jenny Smith" for example did not appear in the search result, it's possible that she turned off this "I want other customers to be able to search for my gift registry" setting in giftregistry.aspx page.

    Name:  giftregistry.jpg
Views: 48
Size:  33.5 KB

  3. #3
    llong is offline Member
    Join Date
    Dec 2008
    Posts
    30

    Default

    Both are confirmed to have public registries. In fact, it was during a search for a specific client's registry that we discovered this problem. The first name search returned what appears to be the first occurance of the name. A first name and last initial was required to return the correct registry.

  4. #4
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    You'll have to provide both firstname and lastname enable to get accurate results, that's the default behavior of 'Search by Name'. You could enhance that by changing the line below.

    From:
    Code:
    public void btnSearchForName_Click(object sender, EventArgs e)
      {
         string sql = "select top 1 CustomerID,GiftRegistryGUID from Customer where ltrim(rtrim(lower(FirstName + ' ' + LastName))) like '%" + DB.SQuote(txtSearchForName.Text.ToLowerInvariant()) + "%' and GiftRegistryIsAnonymous=0 and ShippingAddressID IS NOT NULL and ShippingAddressID<>0 and GiftRegistryAllowSearchByOthers=1";
         DoSearch(sql);
     }
    to:
    Code:
    string sql = "select top 1 CustomerID,GiftRegistryGUID from Customer where ltrim(rtrim(lower(FirstName + ' ' + LastName))) like " + DB.SQuote( "%" + txtSearchForName.Text.ToLowerInvariant() "%" + )" and GiftRegistryIsAnonymous=0 and ShippingAddressID IS NOT NULL and ShippingAddressID<>0 and GiftRegistryAllowSearchByOthers=1";
    * just change the red line above with this one.