Site Search Button Setup in SuiteCommerce

Implement the Site Search button and input bar in SuiteCommerce for enhanced user navigation.

·2 min read·View Oracle Docs

The Site Search button is a crucial feature in SuiteCommerce, providing users with an easy way to search through the site. It is visible by default in the SuiteCommerce Base Theme, and users can click this button to activate the Site Search input bar. This functionality is essential for improving user experience by enabling quick access to site content.

How to Implement the Site Search Button

You can implement the Site Search button within templates for both desktop and mobile views using the following code snippets:

Desktop Code

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

Mobile Code

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

Note: The code provided is backward compatible with Commerce themes created before the 2018.2 release.

Site Search Input Bar

The Site Search input bar is the primary mechanism for users to perform searches on the site. Its implementation allows users to enter search queries easily. You can use the following code to include the Site Search input bar and Go button:

Site Search Code

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

By default, the Site Search input bar is hidden. To make it visible automatically, you can add the active class:

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

Go Button Code

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

Conclusion

Integrating the Site Search button and input bar in your SuiteCommerce site enhances user experience by facilitating easy navigation and access to content.


Key Takeaways

  • Site Search button is essential for user navigation in SuiteCommerce.
  • Easy integration with provided HTML snippets for both desktop and mobile.
  • Customize visibility of the Site Search input bar with the active class.

Frequently Asked Questions (4)

How can I implement the Site Search button in a SuiteCommerce mobile theme?
You can implement the Site Search button in mobile templates using the provided HTML code: `<div class="header-menu-searchmobile" data-view="SiteSearch.Button"></div>`. This code should be inserted within the 'header.tpl' file of the 'Header' module in the Base Theme.
Is the Site Search button compatible with older SuiteCommerce themes?
Yes, the Site Search button code is backward compatible with Commerce themes created before the 2018.2 release. Ensure your theme is compatible by verifying its version before integration.
Which Base Theme files should be modified to add the Site Search button in SuiteCommerce?
To add the Site Search button, modify the 'header.tpl' file in the 'Header' module of the Base Theme.
What happens if my SuiteCommerce theme version is below 2018.2 and I implement the new Site Search button?
The provided Site Search button code is meant to be backward compatible with themes created before version 2018.2. However, you should verify your theme's version to ensure proper integration without issues.
Source: Mobile 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 →