Search by SKU Product Code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 năm cách đây
jcavanaugh wrote:
I'm using Nop 3.2 I managed to achieve the desired results, by changing CatalogController.cs around line 3186

searchSku: searchInDescriptions,

to

searchSku: True,


I also edited around line 3256

searchSku: false,

to

searchSku: true,

so autocomplete also searches part numbers.
10 năm cách đây
Thank You for the reply I'm only able to work in the sql database at this time. I changed the ProductLoadAllPaged searchsku true what it seems I'm missing is the parameter to make the search and autocomplete to use the setting.

Thanks
10 năm cách đây
drhine wrote:
Thank You for the reply I'm only able to work in the sql database at this time. I changed the ProductLoadAllPaged searchsku true what it seems I'm missing is the parameter to make the search and autocomplete to use the setting.

Thanks


Oooops sorry about that, not sure how I missed it.
10 năm cách đây
Hi

Can you provide step by step instructions?

Thanks
9 năm cách đây
Hi
why is the searchSku set to false in  

C:\Projects2013\ChannelManager\Main\Source\ChannelManager\Presentation\Nop.Web\Controllers\CatalogController.cs
public ActionResult SearchTermAutoComplete(string term)

Code:
var products = _productService.SearchProducts(
                storeId: _storeContext.CurrentStore.Id,
                keywords: term,
                searchSku: false,
9 năm cách đây
Heres what I did in version 3.4

Using SQL Management Studio, connect to the database
Open the stored procedure '[ProductLoadAllPaged]'
insert the following around line 57  :
  SET @SearchSku = 1

This resulted in the simple search finding the products by entering the SKU

Also here is how I dealt with the simple products not displaying the SKU in the template

When adding products, we enter the SKU in the short description like this:
<b>SKU:</b> 12345

We also still enter the sku in the sku field but I edited the product templates so that it does not display anywhere.
Instead we just show it as the short description

We enter the product description in the full description which the client likes because it is easier to add HTML formatting using the WYSIWYG editor.

I also modified the product templates to ensure the display order is correct:
Short Description (actually SKU)
Full Description
9 năm cách đây
wow thanks

you really helped me

i tried all the other stuff and it didn't work.


thanks so much for your help.
9 năm cách đây
Thanks! Added to Version 3.5 to search SKU.
Added "SET @SearchSku = 1" After "SET @SearchKeywords = 1" using MS SQL management studio on Stored Procedure ProductLoadAllPaged.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.