Admin > Orders > Search > KeywordSearch >> Product.Name???

Post feature requests to this forum and a pre-configured poll will automatically be created for you.
Post Reply
User avatar
voir
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 24
Joined: Mon Jun 09, 2008 4:25 pm
Location: Belingham, WA US

Admin > Orders > Search > KeywordSearch >> Product.Name???

Post by voir » Tue Sep 02, 2008 4:35 pm

Is this possible? How do I add product information to the order search? I see ordernotes there and considered creating a note when an item is ordered to include the product name category name etc, but I'd rather use builtin keywords if they exist.

Basically the order processing people will need to be able to filter by category or product name to divide the workload.

I also tried adding various items to the dropdownlist like (but not limited to)

Code: Select all

<asp:ListItem Value="Product" Text="Products"></asp:ListItem>
<asp:ListItem Value="Product.Name" Text="Product Name"></asp:ListItem>
<asp:ListItem Value="OrderItems" Text="Order Items"></asp:ListItem>
<asp:ListItem Value="OrderItems.Name" Text="Order Item Name"></asp:ListItem>

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Admin > Orders > Search > KeywordSearch >> Product.Name???

Post by mazhar » Tue Sep 02, 2008 9:45 pm

I also tried adding various items to the dropdownlist like (but not limited to)
Code:
<asp:ListItem Value="Product" Text="Products"></asp:ListItem>
<asp:ListItem Value="Product.Name" Text="Product Name"></asp:ListItem>
<asp:ListItem Value="OrderItems" Text="Order Items"></asp:ListItem>
<asp:ListItem Value="OrderItems.Name" Text="Order Item Name"></asp:ListItem>
It doesn't seems that this will work. You can not add the product information in this way because the search criteria is handled by the back end code and performs certain operation on it which doesn't know any thing about this newly added product info.


User avatar
voir
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 24
Joined: Mon Jun 09, 2008 4:25 pm
Location: Belingham, WA US

Re: Admin > Orders > Search > KeywordSearch >> Product.Name???

Post by voir » Wed Sep 03, 2008 9:43 am

Thank you for looking at this, looks like I will need to add this code to
/conlib/receiptPage.ascx.cs:Page_Init

Code: Select all

        foreach (OrderItem oi in _Order.Items)
        {
            bool containsItemName = false;
            foreach (OrderNote onote in _Order.Notes)            
            {
                if (!containsItemName)
                {
                    if (onote.Comment==oi.Name)
                    {
                        containsItemName = true;
                    }
                }
            }
            if (!containsItemName)
            {
                OrderNote newNote = new OrderNote(_OrderId, _Order.UserId, DateTime.Now, oi.Name, NoteType.Private);
                newNote.Save();
            }
                
        }

and have them search OrderNotes for Product Name

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Admin > Orders > Search > KeywordSearch >> Product.Name???

Post by mazhar » Thu Sep 04, 2008 10:58 pm

It seems that this will work because on the advance order search the Order Notes option for keyword actually looks inside the comment. So if order contains the product name in comment then it could be searched from the order search.

Post Reply