Page 1 of 1

search on customer side.

Posted: Fri Apr 04, 2008 11:34 am
by mkeith1
the search option which appears in the top border of the customer side allows for a search by name or keyword, any chance of adding Sku to this search? I know you can search by name, description or sku in the advanced search, but that's an extra click for the customer to go to this page.

Re: search on customer side.

Posted: Fri Apr 04, 2008 1:36 pm
by jmestep
Let's bombard mazhar and maybe he can some up with some code. The search is pretty puny as it is now.

Re: search on customer side.

Posted: Sat Apr 05, 2008 5:43 am
by m_plugables
Edit the ConLib/SearchPage.ascx.cs and locate the following line of code

Code: Select all

ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);
and replace it with the following lines of code

Code: Select all

int startIndex = (_HiddenPageIndex * _PageSize);
        if(startIndex == (-1*_PageSize))
            startIndex = 0;
        ProductList.DataSource = ProductDataSource.AdvancedSearch(_Keywords, this.CategoryId, _ManufacturerId, true, true, true, 0, 0, _PageSize, startIndex, SortResults.SelectedValue);

Re: search on customer side.

Posted: Sat Apr 05, 2008 8:31 am
by jmestep
Thanks, this works great.

Re: search on customer side.

Posted: Mon Apr 07, 2008 12:20 pm
by mkeith1
yes, exactly what i needed! This takes me one step closer to going live!

Re: search on customer side.

Posted: Wed Apr 16, 2008 1:37 pm
by Shopping Cart Admin
Hello Judy,
The search is pretty puny as it is now.
It's a matter of speed of searching via text, we removed those extra fields per a bug report posted by me. Most customers are not searching via SKU.

Re: search on customer side.

Posted: Thu Apr 17, 2008 12:07 pm
by mkeith1
Yeah, but it really is great to be able to search by sku. Thanks again Mazhar.

Re: search on customer side.

Posted: Mon Jul 21, 2008 9:14 am
by Robbie@FireFold
I actually need this in one more spot.

/Admin/Catalog/Search.aspx

Can we change that to have the ability to search by SKU?

Re: search on customer side.

Posted: Tue Jul 22, 2008 11:23 am
by Robbie@FireFold
Addition.

I'd like to see if there was an easy way to implemete searching by SKU everywhere?

My entire staff/customer base pretty much uses SKU's instead of description.

Re: search on customer side.

Posted: Thu Jul 24, 2008 2:48 pm
by igavemybest
Didnt want this to get lost. Just wanted to rehash the last post.... Is there any way to search by squ everywhere?

Re: search on customer side.

Posted: Thu Jul 24, 2008 6:56 pm
by Mike718NY
If I do a search with a space before or after the SKU number,
no results show up. This is also true in the "Advanced Search".

This variable (and all search variables) needs to be trimed.
Can someone show me where I could add a "Trim" to this value? thanks

Re: search on customer side.

Posted: Thu Jul 24, 2008 9:05 pm
by Robbie@FireFold
Mike718NY wrote:If I do a search with a space before or after the SKU number,
no results show up. This is also true in the "Advanced Search".

This variable (and all search variables) needs to be trimed.
Can someone show me where I could add a "Trim" to this value? thanks
Just recently noticed this.

I would like to see a fix for this and be able to search by SKU everywhere.

Re: search on customer side.

Posted: Mon Jul 28, 2008 10:49 am
by Robbie@FireFold
Bump for this week. Any thoughts?

Re: search on customer side.

Posted: Mon Jul 28, 2008 3:40 pm
by jmestep
In SimpleSearch.ascx.cs, add .Trim() to the end of this line:
string safeSearchPhrase = StringHelper.StripHtml(SearchPhrase.Text).Trim();

Re: search on customer side.

Posted: Thu Aug 14, 2008 1:00 pm
by Mike718NY
Thanks Judy. Just got around to doing this. Worked great.


Another solution to this problem would be what I did:
Add the Sku to the SearchKeywords field:

UPDATE ac_Products
set SearchKeywords = (ISNULL(SearchKeywords + ' ', '') + CAST(Sku AS VARCHAR(50)))

Re: search on customer side.

Posted: Thu Aug 14, 2008 1:13 pm
by Robbie@FireFold
Mike718NY wrote:Thanks Judy. Just got around to doing this. Worked great.


Another solution to this problem would be what I did:
Add the Sku to the SearchKeywords field:

UPDATE ac_Products
set SearchKeywords = (ISNULL(SearchKeywords + ' ', '') + CAST(Sku AS VARCHAR(50)))
Any solutions on searching by SKU in the Admin/anywhere else?

Re: search on customer side.

Posted: Wed Aug 27, 2008 10:52 am
by Thessyn
Yes. This is extremely useful. Thanks!

I agree that the benefits of searching by SKU well outweigh the speed disadvantages. I bet a lot of other AC customers would agree!

Re: search on customer side.

Posted: Mon Sep 08, 2008 1:17 pm
by mkeith1
Yes! Yes, Making search by sku on the admin side would help. Now you have to search by sku on the advanced search of the retail side (if you didn't alter the search script), then the easiest way is to copy the name as it appears there and paste to the name search on the admin side. (Commas, apostrophies, quotes, etc.).

It would also be nice if the advanced search on the customer side had the ability to search "all words", "any words" or "string" like version 5 could.

Also, When you use the search on the customer side, there's are options for name, description or Sku, Do any of these options search "key words"?

And is there a way to eliminate searching by "price range"?

Re: search on customer side.

Posted: Mon Sep 08, 2008 3:01 pm
by Robbie@FireFold
I made all the boxes checked when the page loads.

I still still SKU search on admin side.

Re: search on customer side.

Posted: Mon Oct 06, 2008 5:59 pm
by jmestep
This is to revisit mazhar's code above. I just had a client point out that with that substitution the SimpleSearch.ascx will return products by SKU, but it also shows the message
Displaying items 0 - 0 of 0 and

No products match your search criteria.

The problem is around line 50
_SearchResultCount = ProductDataSource.NarrowSearchCount(_Keywords, this.CategoryId, _ManufacturerId, 0, 0);

where it is pulling from the NarrowSearchCount

The ProductDataSource.AdvancedSearch doesn't have a Count method. I've fooled around some trying to find the count of the results, but haven't come up with a way yet.
Anyone?
Thanks

Re: search on customer side.

Posted: Tue Oct 14, 2008 7:08 pm
by combra
For the regular search field for when a customer searches, is there anyway to have it show either webpages or categories that don't have any products in them? For example, I have created categories that have webpages with amazon product widgets in them to complement the items that I do sell. These categories don't show up in the search, and I would like them to. I have removed the advanced search so this question is just for the regular search bar. Possible?

Re: search on customer side.

Posted: Mon Apr 20, 2009 5:13 pm
by bemara579
bump

Re: search on customer side.

Posted: Tue Apr 21, 2009 9:13 am
by mazhar
Only catalog search on admin side can list webpages. You can try to write some search module using that search function from CommerceBuilder.Catalog.CatalogDataSource.

Re: search on customer side.

Posted: Wed Aug 05, 2009 10:48 am
by kastnerd
Is this still true for 7.0.3?