WordPress :: Divi Theme :: Custom size for WooCommerce thumbnails.
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_divi_woocommerce_image_dimensions() {
$catalog = array(
'width' => '400',
'height' => '400',
'crop' => 1,
);
$single = array(
'width' => '510',
'height' => '9999',
'crop' => 0,
);
$thumbnail = array(
'width' => '157',
'height' => '157',
'crop' => 1,
);
update_option( 'shop_catalog_image_size', $catalog );
update_option( 'shop_single_image_size', $single );
update_option( 'shop_thumbnail_image_size', $thumbnail );
}
add_action( 'admin_init', 'my_et_divi_woocommerce_image_dimensions', 50 );