Is there a way to edit serach term format in search landing page title.
For example, how to change from: SEARCH RESULTS FOR TEST
to: SEARCH RESULTS FOR "TEST"
By default, Magento already has a single quote appended to the search term. Like:
However, if you wish to change it, you can add a translation string to the en_US.csv file and add the below strings
Search results for: '%1'
Translate to
Search results for "%1"
Or If the above doesn't work, you can also create a preference or plugin of the class, \Magento\CatalogSearch\Block\Result and modify the method getSearchQueryText
From:
/**
* Get search query text
*
* @return \Magento\Framework\Phrase
*/
public function getSearchQueryText()
{
return __("Search results for: '%1'", $this->catalogSearchData->getEscapedQueryText());
}
To
/**
* Get search query text
*
* @return \Magento\Framework\Phrase
*/
public function getSearchQueryText()
{
return __('Search results for: "%1"', $this->catalogSearchData->getEscapedQueryText());
}
Result: