Site Search Button Functionality in SuiteCommerce

The Site Search Button enhances SuiteCommerce by providing users easy access to a dedicated search input bar for website navigation.

·2 min read·View Oracle Docs

The Site Search button is a crucial feature of the SuiteCommerce Base Theme, enabling users to initiate searches on a website easily. When clicked, this button activates the Site Search input bar, allowing users to enter search queries effectively. Below is a breakdown of how to implement and customize this feature for both desktop and mobile platforms.

How Does the Site Search Button Work?

The button is included by default within the theme but requires user interaction to reveal the search input. It can be placed in any template for both desktop and mobile with specific HTML code snippets.

Implementation for Desktop

To add the Site Search button to your desktop template, use the following HTML snippet:

html
<div class="header-menu-search" data-view="SiteSearch.Button"></div>
  • Base Theme Module: Header
  • Base Theme Template: header_menu.tpl

Implementation for Mobile

For mobile templates, the HTML code slightly differs:

html
<div class="header-menu-searchmobile" data-view="SiteSearch.Button"></div>
  • Base Theme Module: Header
  • Base Theme Template: header.tpl

Site Search Input Bar

The Site Search input bar allows users to enter their search queries. By default, this input bar is hidden, but you can customize your templates to make it visible.

HTML Structure for the Site Search Input Bar

To implement the Site Search input and the accompanying Go button, use the following code snippet:

html
1<div class="site-search" data-type="site-search">
2 <div class="site-search-content">
3 <form class="site-search-content-form" method="GET" action="/search" data-action="search">
4 <div class="site-search-content-input">
5 <div data-view="ItemsSeacher"></div>
6 <i class="site-search-input-icon"></i>
7 <a class="site-search-input-reset" data-type="search-reset"><i class="site-search-input-reset-icon"></i></a>
8 </div>
9 <button class="site-search-button-submit" type="submit">{{translate 'Go'}}</button>
10 </form>
11 </div>
12</div>
  • Base Theme Module: SiteSearch
  • Base Theme Template: site_search.tpl

To make the search input bar visible by default, add the active class as follows:

html
<div class="site-search active" data-type="site-search">

Go Button Implementation

The Go button is an essential part of the search functionality, allowing users to submit their search requests easily. Here’s how to include it in your template:

html
<button class="site-search-button-link" data-action="show-itemsearcher" title="{{translate 'Search'}}">
<i class="site-search-button-icon"></i>
</button>
  • Base Theme Module: SiteSearch
  • Base Theme Template: site_search_button.tpl

Key Points to Remember

  • The Site Search button is essential for user navigation and engagement on SuiteCommerce sites.
  • Customizing the input bar to be visible can enhance the user experience significantly.
  • Ensure compatibility with previous theme versions if your site predates the 2018.2 release.

Frequently Asked Questions (4)

Is the Site Search button feature available for both desktop and mobile SuiteCommerce themes?
Yes, the Site Search button feature is available for both desktop and mobile SuiteCommerce themes, with specific HTML snippets provided for each.
Do I need to make any significant modifications to older themes to implement the Site Search button?
No significant modifications are necessary as the provided code is backward compatible with themes created prior to the 2018.2 release.
Which templates do I need to modify to add the Site Search button in SuiteCommerce?
For desktop, modify the 'header_menu.tpl' template. For mobile, modify the 'header.tpl' template.
Is any additional configuration needed after adding the Site Search button HTML snippet to the templates?
The article does not specify additional configuration steps, so it appears that adding the HTML snippet as described should suffice.
Source: Site Search Button Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Commerce

View all Commerce articles →