Woocommerce product customization

Hi!

I have two things that I was unable to change, can you please give me a hand?

https://www.staging.optika-kobacic.hr/katalog/ray-ban-ray-ban-8901-5244/

1.
I want to change the magnifying glass icon. I have tried this:

.woocommerce-product-gallery__trigger .emoji {
    display: none !important;
}

.woocommerce-product-gallery__trigger {
    font-family: "FontAwesome";
    font-style: normal;
    font-weight: normal;
    text-decoration: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    color:#000
}

.woocommerce-product-gallery__trigger:before {
    content: "\f002";
}

However, it seems that the .emoji class isn’t getting applied. Emojis are not disabled on the site.

2.
I have tried to change the “Related products” and “You may also like” text. It seems it doesn’t take effect:

This is in the Child theme:

add_filter('gettext', 'x_translate_text1' );
function x_translate_text1($translated) {
	$translated = str_ireplace('Related products', 'Možda nešto slično?', $translated);
	$translated = str_ireplace('You may also like', 'Pogledajte još...', $translated);
	return $translated; 
}

Perhaps because the site language is not English?

Thanks!

Hi @Misho,

Thank you for reaching out to us.

  • To change the magnifying glass icon please use this code instead:
a.woocommerce-product-gallery__trigger {
    visibility: hidden;
}
.woocommerce-product-gallery__trigger:before {
    visibility: visible;
    content: "\f002";
    font-family: "FontAwesome";
    font-style: normal;
    font-weight: normal;
    text-decoration: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    color:#000
}
  • For the strings translation please note: the $translation = array() contains the original string and the translation string. The original string should match the extract string you wish to translate. Any space or mismatched characters will invalidate the translation. You can try the following code instead:
add_filter('gettext', 'x_translate_text' , 20, 3);
function x_translate_text ( $translated_text, $text, $domain ) {
	$translated_text = str_ireplace("Related products", 'Možda nešto slično?', $translated_text);
	$translated_text = str_ireplace("You may also like", 'Pogledajte još...', $translated_text);
	return $translated_text;
}

If your site is not in English and doesn’t contain those strings then the above code won’t work.

Hope this helps!

  1. Icon changed!

  2. Your code worked! I have placed the Croatian string and it translated it. The old code couldn’t translate Croatian.

All solved, thanks!

You’re welcome!
We’re glad @Nabeel were able to help you out.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.