Woocommerce : How to crop the product image

If you want to crop the product image ( > woocommerce 3.1 )then kindly follow the below steps.

Open the file in this path /wp-content/themes/theme-folder/function.php using some editor like DreamWeaver.

If you have activated the child theme then Open the file in this path /wp-content/themes/childtheme-folder/function.php using some editor like DreamWeaver and append the below code.


add_filter( 'woocommerce_get_image_size_single', 'my_set_product_img_size' ); add_filter( 'woocommerce_get_image_size_shop_single', 'my_set_product_img_size' ); add_filter( 'woocommerce_get_image_size_woocommerce_single', 'my_set_product_img_size' ); function my_set_product_img_size() { $size = array( 'width' => 497, 'height' => 530, 'crop' => 1, ); return $size; }

Note : You have to replace the width and height value as per your need..

After adding the filter you must have to regenerate the thumbnails using the regnerate plugin. Then only it will reflect on the front end.

Rate This Article

(5 out of 14 people found this article helpful)

Leave A Comment?

This site uses Akismet to reduce spam. Learn how your comment data is processed.