This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Put those code inside theme's or child-theme's function.php */ | |
add_filter('woocommerce_get_image_size_gallery_thumbnail', function ($size) { | |
return array( | |
'width' => 40, | |
'height' => 50, | |
'crop' => 0, | |
); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('disable_wvg_enqueue_scripts', function() { | |
if ( is_product() ) { | |
return false; | |
} | |
return true; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woo_variation_gallery_post_thumbnail_id', function ( $post_thumbnail_id, $attachment_ids, $product ) { | |
$id = $product->get_image_id(); | |
if ( $post_thumbnail_id == $id ) { | |
$post_thumbnail_id = array_shift( $attachment_ids ); | |
} | |
return $post_thumbnail_id; | |
}, 10, 3 ); | |
add_filter( 'woo_variation_gallery_attachment_ids', function ( $attachment_ids, $post_thumbnail_id, $product ) { | |
if ( in_array( $post_thumbnail_id, $attachment_ids ) ) { |