Fixing 'No Results' Message Grammar in BigCommerce Foundry/Moody Themes
BigCommerce store owners and developers often encounter situations where they need to fine-tune the text displayed on their storefront. While many static text elements are easily found within the theme's language files, dynamic components, especially those in modern Stencil themes like Foundry and Moody, can present a unique challenge. This community insight explores a common issue: correcting grammatical errors or customizing "no results" messages on search pages, and provides a robust solution.
The Challenge: Grammatical Errors in Search Results
A BigCommerce merchant, Simon Lawther, initiated a forum thread seeking help to correct a grammatically incorrect "no results" message displayed on their Foundry/Moody theme's search page. The message read: "We're sorry, there don't seem to be any results that meet your criteria." Simon's initial attempts to locate and modify this string in the standard Templates Pages Search area proved fruitless, highlighting a common frustration when dealing with theme customizations that aren't immediately obvious.
Initial Approaches and Misconceptions
The first suggestion from community expert Sri Vathson pointed towards the theme's language (translation) files, specifically lang/en.json. This is typically the go-to location for modifying static text strings in BigCommerce themes. The recommendation was to navigate to Storefront → My Themes → Customize → Edit Theme Files, open lang/en.json, and search for keywords like no_results or portions of the displayed message, such as:
"search": { "no_results": "We could not find any results matching your criteria." }
However, Simon confirmed that the problematic string was not present in the en.json file, indicating a deeper integration within the theme's structure.
Uncovering the Dynamic Nature of Stencil Themes
As the discussion evolved, it became clear that for themes like Foundry and Moody, especially concerning dynamically rendered elements like search results, the message might be hardcoded within a component or a JavaScript file. Sri Vathson suggested looking in:
templates/components/search/templates/components/common/- Theme JavaScript files (within the
assets/js/folder)
This pointed towards the necessity of a more comprehensive search method beyond the BigCommerce theme editor's basic file browsing.
The Definitive Solution: Global Search in Downloaded Theme Files
The most effective and ultimately successful solution was provided by Sajid Jameel from Codinative.com. He highlighted that since search results in Foundry/Moody themes are often rendered dynamically, the string could be hardcoded directly within a JavaScript file that builds the search results on the fly, or within a specific component template.
The recommended approach involves:
- Download Your Theme: Go to Storefront → My Themes → Advanced → Download Theme.
- Use a Code Editor: Open the downloaded theme folder in a powerful code editor like Visual Studio Code, Sublime Text, or Notepad++.
- Perform a Global Search: Utilize the editor's global search function (e.g.,
Ctrl+Shift+Fon Windows orCmd+Shift+Fon Mac) to search for a partial phrase of the problematic text. For Simon's case, "don't seem to be any results" or "meet your criteria" would be effective. This search will scan all files within the theme, including HTML templates, JavaScript files, and CSS. - Identify Likely Locations: Based on the search, the string is often found in:
templates/pages/search.html- Files within the
assets/js/folder (look for search-related JS files) - Files within
templates/components/search/
- Edit and Re-upload: Once the string is located and edited to the desired wording (e.g., "We could not find any results matching your criteria."), save the file. Then, re-upload the modified theme via Storefront → My Themes → Advanced → Upload Theme.
Simon confirmed that this method successfully allowed him to locate and fix the issue, expressing gratitude for the community's swift and accurate suggestions.
Key Takeaways for BigCommerce Customization
This thread underscores a crucial aspect of BigCommerce Stencil theme customization: not all text strings reside in language files. For dynamic elements, especially in complex themes like Foundry and Moody, developers and merchants must be prepared to delve into the theme's underlying structure, including JavaScript and component templates. Leveraging powerful code editors for a global search across all theme files is an indispensable technique for tracking down elusive text strings and ensuring precise control over storefront messaging.