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

Thread: Order Search by Customer Not Working

  1. #1
    Tom Cox is offline Senior Member
    Join Date
    Nov 2009
    Location
    Los Angeles, CA
    Posts
    104

    Default Order Search by Customer Not Working

    Hello,

    On our ML7 version the search of orders by order number works perfectly, but searching by customer name never returns any orders. We find an order, cut and paste the name into the search by name field and still not get a match. (Yes, the new only flag is set correctly.)

    I'm testing now on ML8 and the search still isn't working properly. It works maybe 5% of the time and rest of the time, we get zero results. We have tried searching by first name only, last name only, full name. I have cut and pasted a name from an actual order and still no results.

    Is anyone using the search orders by customer name successfully in any version?

    Thanks,
    Tom

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

    Default

    It worked for me just fine. I took a look the code-behind in order.aspx.cs and it's filtering the {firstname + lastname} fields.

    Code:
     if (txtCustomerName.Text.Trim().Length != 0)
                {
                    result += String.Format(" and ((FirstName + ' ' + LastName) like {0})", DB.SQuote(txtCustomerName.Text.Trim()));
                }
    you can modify it to something like below, if you want another option of filtering orders either by firstname, lastname, or Firstname + Lastname.

    Code:
    if (txtCustomerName.Text.Trim().Length != 0)
                {
                    result += String.Format(" and ((FirstName + ' ' + LastName) like {0})", DB.SQuote(txtCustomerName.Text.Trim()));
                    result += String.Format("or ((FirstName) like {0})",DB.SQuote(txtCustomerName.Text.Trim()));
                    result += String.Format("or ((LastName) like {0})", DB.SQuote(txtCustomerName.Text.Trim()));
                }
    If you've entered "Tom Cox" or Tom or Cox, then all orders under that name should appear, given those orders are within the date range specified in 'Start and End' date fields.

    Name:  order.jpg
Views: 27
Size:  8.4 KB

  3. #3
    Tom Cox is offline Senior Member
    Join Date
    Nov 2009
    Location
    Los Angeles, CA
    Posts
    104

    Default

    Thanks Alfred,

    Yeah, I assumed if this was not working for anyone, you'd know about it, so I figured it has to be something on our site. I'll check the code as you suggest.

    We don't have the source code yet for ML8 but I can check in ML7.

    I was told by support that we could search for first or last name, but I've actually tried cut and paste with a complete name on the orders and it doesn't work. (I've also tried entering manually of course.) So there is probably something with hidden chars or something with the code.

    I'll check the code as you mention and see what I can see.

    Thanks,
    Tom