What I tried:
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
in css:
.woocommerce-product-gallery__trigger img {
display: none !important; ---///this works in chrome but not in mozilla
}
in js i tried without and with setTimeout:
setTimeout(() => {
$('woocommerce-product-gallery__trigger').find('img').removeAttr('alt');
$('woocommerce-product-gallery__trigger').empty() ---////this tried when remove supports emoji in WP(see first 2 remove_action())
$('woocommerce-product-gallery__trigger').contents().remove()---////this tried when remove supports emoji in WP(see first 2 remove_action())
},2000)
Also i went to woocommerce plugin assets/js/single-product.js and remove this glass from this.$target.prepend( '<a href="#" class="woocommerce-product-gallery__trigger">HERE IT WAS</a>')
2
Answers
This what i did, not ideal, but...
setTimeout()
is needed, maybe better put this intoafter_setup_theme
hook, without setTimeout, but this works for me.If you want to remove Magnifying glass icon and disable zoom function on product page Woocommerce, you can follow this full tutorial Remove Magnifying glass icon and disable zoom function on product page Woocommerce:
Edit woocommerce.css
Connect to your website using FTP protocol, then go to /youwebsite.com/wp-content/plugins/woocommerce/assets/css/woocommerce.css
Edit this file with text editor tool and find class:
.woocommerce div.product div.images .woocommerce-product-gallery__trigger
, add display:none; to this class and it will be like this:You can also hide Magnifying glass icon using your child theme’css file