Cropping Woocommerce not working the way it should?

I've tried everything I can find on the internet. Here are my current woocommerce crop settings:

Woocommerce settings

The problem is that after re-creating the images and returning to this page, I get this:

Woocommerce settings sadness

Why do this and how can I fix it?

UPDATE

In fact, after restoring the resulting images, it doesn't reset the hard print parameters. It just saves it as a "hard cut" after I take them off, even though it initially shows that I changed it?

UPDATE 2

It seems to be related to this .

UPDATE 3

I tried to add this:

add_action( 'aftersetup_theme', function () {

    // Add image sizes
    $shop_thumbnail = wc_get_image_size( 'shop_thumbnail' );
    $shop_catalog   = wc_get_image_size( 'shop_catalog' );
    $shop_single    = wc_get_image_size( 'shop_single' );

    // In the lines below, true = hard crop; false = proportional
    $shop_thumbnail['crop'] = false;
    $shop_catalog['crop'] = false;
    $shop_single['crop'] = false;

    add_image_size( 'shop_thumbnail', $shop_thumbnail['width'], $shop_thumbnail['height'], $shop_thumbnail['crop'] );
    add_image_size( 'shop_catalog', $shop_catalog['width'], $shop_catalog['height'], $shop_catalog['crop'] );
    add_image_size( 'shop_single', $shop_single['width'], $shop_single['height'], $shop_single['crop'] );
}, 20 );

      

And then I created the images again and still no luck?

UPDATE 4:

The site can be viewed here:

http://www.diamondcouturelondon.co.uk/

      

UPDATE 5:

Installed plugins include:

  • Contact Form 7
  • Lollum Framework
  • oAuth Twitter Feed for Developers
  • Regenerating miniatures
  • Revolutionary slider
  • WooCommerce
  • YITH WooCommerce Wishlist

UPDATE 6:

I have disabled ALL plugins except WooCommerce. Then I went to this page:

/wp-admin/admin.php?page=wc-settings&tab=products

      

There I turned off the "hard edge" again next to all elements. I pressed the save button. Items are unchecked after reload but if I refresh the page they get checked. Thus, the changes were not saved. In other words, WITH ONLY WOOCOMMERCE is on, it STILL does not save my hard crop settings.

This leaves me with only one other possible external influence → topic. But I don't see how it might affect that.

+3


source to share


1 answer


Can you try this?



add_filter( 'woocommerce_get_image_size_shop_thumbnail',    'force_crop_woocommerce' );
add_filter( 'woocommerce_get_image_size_shop_catalog',      'force_crop_woocommerce' );
add_filter( 'woocommerce_get_image_size_shop_single',       'force_crop_woocommerce' );


function force_crop_woocommerce( $size ){
    $size['crop'] = 0;
    return $size;
}

      

+5


source







All Articles