Close

Not working on manually added search bar

Juson
8 years ago
#11962 Quote
Avatar
  • 25
Hello.


I added a search bar on the body part of main page.

Just after I added, instant search had been not working. But I tried something(I don't remember), I saw it was working. Then I wanted to arrange the website, made the search bar again, instant search has not been working until now. Not install or setting problem, it works on original search bar.

I want to know what the problem is.


Plus, I hope to add the new search bar per multi-store. I added the code


<li class=home-search-box>
    <center>@Html.Action("SearchBox", "Catalog")</center>
</li>


at Themes\Brooklyn\Views\Catalog\HomepageCategories.cshtml, it appears on all of my multi-store. It is not a plug-in, so I cannot use 'store' menu. Any advice?

This is my website.
http://www.yang-man.com/




Thanks & Regards

Juson
iliyan.tanev
8 years ago
#11964 Quote
Avatar
  • Moderator
  • 347
Hi,

For some reason, you have two elements with class instantSearchResourceElement. There should be only one. I suppose you have done some custom modifications trying to integrate the Instant Search plugin more than once on your home page. Unfortunately, the plugin can not be integrated more than once. 

Maybe you have tried to add additional widget zone in the SupportedWidgetZones.xml file that can be found in the plugin folder? 

For the per store integration of the default nop search box: you can restrict it per store using the store id that you can get in the view with the following code:

var storeId = EngineContext.Current.Resolve<IStoreContext>().CurrentStore.Id;


and then the code for the search box will look something like this:

if(storeId != someStoreId) {

<li class=home-search-box>
    <center>@Html.Action("SearchBox", "Catalog")</center>
</li>

}


Hope this helps!
Regards,
Iliyan Tanev
Nop-Templates Dev Team