Skip to main content

Search Page

Search page is the page where user can search for the products.

Steps:

  1. You can add the search page in the src/pages folder of your theme and name it searchPage.js.

Here is an example of how the search page can be created. You can add the blocks as per your requirement.

const searchPage = {
title: 'Search',
attributes: {
headerShown: false,
backgroundColor: '#fff',
},
stickyHeader: {
blocks: [
{
name: 'shopify/search-block',
attributes: {},
},
],
},
blocks: [
{
name: 'shopify/search-suggest',
attributes: {},
},
{
name: 'shopify/collection-suggest',
attributes: {
__display: '{{!checkIfTrueFalse(plugins.shopify.settings.hide_collection_suggest)}}',
},
},
],
};

export default searchPage;
  1. On pages/index.js, need to return the searchPage. Page id of the search page should be searchPage.
import searchPage from './searchPage';

const pages = {
// other pages
searchPage,
}
export { pages }