user1724434
user1724434

Reputation: 708

I can't change the product image size for woocommerce

I am trying to change the image size in the individual product page to be 600px X 700px however any changes from woocommerce product settings don't do anything even after I regenerate all thumbnails. I think that something in my theme css is setting my product page image size but I can't figure out what it is so I can change it.

Also it would be a plus if I can remove the image border. Here is a link to a product to see the issue I'm having.

http://goo.gl/OpLkMA

Upvotes: 4

Views: 15238

Answers (4)

Cyril KIM
Cyril KIM

Reputation: 1

Found this [Changing image sizes via hooks

Whilst themes can fix image sizes at certain widths, and store owners can control widths and aspect ratios, if you need more control over thumbnail sizes there are some hooks available to you. The wc_get_image_size function is used by WooCommerce to get the image size dimensions. The return value of this is passed through a filter: woocommerce_get_image_size_{SIZE_NAME_WITHOUT_WOOCOMMERCE_PREFIX} If using this hook you’ll be passed an array of sizes, similar to this:

array(
    'width' => 200,
    'height' => 200,
    'crop' => 1,
)

So for example, if I wanted to change gallery thumbnails to be 150x150px uncropped images, you could use the following code:

    add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) {
return array(
    'width' => 150,
    'height' => 150,
    'crop' => 0,
);  } );

READ MORE HERE

Upvotes: 0

user12293087
user12293087

Reputation: 1

This will help you!

add_filter( 'woocommerce_get_image_size_thumbnail', function( $size ) {
    return array(
    'width' => 427,
    'height' => 427,
    'crop' => 0,
    );
    } );

Upvotes: 0

user1724434
user1724434

Reputation: 708

[SOLVED] It was in the theme file, each theme is different so posting the file name that I found mine in is likely irrelevant to anyone having this issue.

What you must do is look through your theme to see what size it renders thumbnails. In my case, the largest width size of thumbnails was 360px. Once I found the code below I simply changed it to 600px and then regenerated my thumbnails. That did the trick, I hope it helps someone with the same issue.

` /* ====== Product single thumb size ====== */

add_image_size( 'tw_shop_single', 360, 999, false );`

Upvotes: 2

Nik Dow
Nik Dow

Reputation: 614

A complete description of how to match Woocommerce thumbnail sizes with your theme is on our blog at http://www.cbdweb.net/woocommerce-and-image-sizes/ including links to the relevant Woocommerce documentation. This question relates to how to change the size that images are displayed and the solution found is correct, but you still need to make sure the images stored by Woocommerce are resized to correctly match your (modified) theme.

It's also worth creating a child theme rather than modifying the theme directly. See documentation at http://codex.wordpress.org/Child_Themes

Upvotes: 0

Related Questions