In Latest WooCommerce How I set Hard crop for Single Product Image
-
In latest WooCommerce there is no option to enable hard crop for single product image on WooCommerce settings area.So that i have written a function in function.php for enabling hard crop for single image.
function ne_theme_setup() {
add_image_size( ‘single-product’, 600, 600, true );
}
add_action( ‘after_setup_theme’, ‘ne_theme_setup’ );function custom_product_large_thumbnail_size() {
return ‘single-product’;
}
add_filter(‘woocommerce_gallery_image_size’, ‘custom_product_large_thumbnail_size’);
this code is working but when i select variable on single product page at that time image is changing and showing uncropped version of image.How i solve this issue ? I want to display single image with 600X600 with hard crop for all variations of product.
- The topic ‘In Latest WooCommerce How I set Hard crop for Single Product Image’ is closed to new replies.