• Resolved JDTravel

    (@jdtravel)


    I’ve updated to 3.3.1 and there is no option to crop the single product page image.
    In Appearance -> Customize -> Woocommerce -> Product Images
    There are settings to crop the Thumbnails, but for the ‘Main Image’ there is a message saying:
    “Image size used for the main image on single product pages. These images will remain uncropped”

    I have product images with differing dimensions and in Woocommerce Version 3.2.6, I could crop them to display as a uniform size. After updating to Version 3.3.1 only the width is uniform and the height varies depending on the original dimensions of the image. It’s not an option to reformat and re-upload each image.
    Please can the old cropping functionality be returned.
    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same issue. Would love to see this addressed as well as better Product Gallery handling out of the box. I have to always add this to my functions.php

    add_action( 'after_setup_theme', 'image_setup' );
    
    function image_setup() {
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
    }
    Thread Starter JDTravel

    (@jdtravel)

    I’ve just received a similar fix from author of my website theme. Hope Woocommerce can be updated to properly address this soon.

    Right on. I just used the code I mentioned before, but omitted a couple lines.

    add_action( 'after_setup_theme', 'image_setup' );
    
    function image_setup() {
    add_theme_support( 'wc-product-gallery-lightbox' );
    }

    The issue was with the slider option since it moves the images around. The overall layout is still kind of an eyesore to me.

    Thread Starter JDTravel

    (@jdtravel)

    This is the code I received to fix the issue, it’s to go in the themes function.php
    I’m not a coder so don’t know if it will only work with the specific theme I’m using.

    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;
    }

    I’m trying to figure this out as well. I just want all single product images to be 600 x 600 and with cropping.

    How can i make this happen?

    @erdogandk

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

    this should do the trick

    • This reply was modified 6 years, 7 months ago by guyhaines.
    Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    Hi there!

    There hasn’t been a reply for a while so I’m going to close this ticket.

    If you’re still having problems please open a new ticket, thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No Option to Crop Main Product Image’ is closed to new replies.