How to change labels?

The search displays several permanent labels like “See all products…”, “No results”, “SKU”, “Tags”. etc. Several of them can be changed in the plugin settings. We have come up with some hints on how you can change each of them.

Changing basic labels via the settings page

You can change the following labels via the settings page. To do so, go to WooCommerceFiboSearch. You will find these options under the Search bar and Autocomplete tab.

  1. Placeholder
  2. Submit text
  3. More results
  4. No-results

Changing other labels via PHP

Changing the rest of the labels requires custom PHP snippets. You have to paste the following code samples into functions.php in your child theme or use the Code Snippets plugin.

Change SKU label

add_filter( 'dgwt/wcas/labels', function ( $labels ) {

	$labels['sku_label'] = 'ISBN:'; // Change label "SKU:" to "ISBN:"

	return $labels;
} );

After applying this code, the SKU label should be replaced with the ISBN label.

Change other labels

Here is a list of all the keys of the labels you can change. Take a look at the “Change SKU label” headline. You can use this code for every label. Just change the key.

KeyLabel
tax_product_catCategory
tax_product_cat_pluCategories
tax_product_tagTag
tax_product_tag_pluTags
product_pluProducts
postPost
post_pluPosts
pagePage
page_pluPages
sku_labelSKU:
inin
read_morecontinue reading
no_resultsNo results
show_moreSee all products…
show_more_detailsSee all products…
search_placeholderSearch for products…
submitSearch
tax_{taxonomy-name}Custom taxonomy name
tax_{taxonomy-name}_pluCustom taxonomy name (plural)
search_histYour search history
search_hist_clearClear