fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Arnel Erovic

Hi,

I see there are tickets regarding your dependency on dashicons (dashicons.min.css).

I would also like to bring your attention to this problem.

dashicons.min.css file size is 35 kb, which doesn’t seem like much, but it is the largest css file on our site. Even larger than our main css file.

And the only purpose for loading the entire dashicon-file is for displaying only one icon on our site.

We are not using arrow icons but we are using the expand image icon, which seems to be the only icon on the frontend using dashicons on our site.

We would like to replace this icon with something else if your plugin allowed dequeueing and deregistering dashicons.min.css.

Thank you for an otherwise great plugin.

 

 

Hakik Zaman

Hi Arnel,

Thanks for reaching out to us.

You can try the following snippet using the Code Snippets plugin:

add_action('wp_enqueue_scripts', function(){
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
if( is_woocommerce() ){
wp_deregister_style( 'dashicons' );

wp_deregister_style( 'woo-variation-gallery' );
wp_enqueue_style( 'woo-variation-gallery', esc_url( woo_variation_gallery()->assets_url( "/css/frontend{$suffix}.css" ) ), array( ), woo_variation_gallery()->assets_version( "/css/frontend{$suffix}.css" ) );
}
});

Then you can use your own icon or image as you want.

Thank You

Arnel Erovic

Hi,

Thank you for providing the code snippet. I’ve implemented it using the code snippets as you suggested. The solution works perfectly! Now I can use my own icon or image as desired.

I appreciate your prompt assistance.

Best regards