This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

WooCommerce Image Sizes Options

  • Creator
    Topic
  • #25145
    askwpgirl
    Participant

    Hi Jason,

    Using Jump Start, the normal image size options available under WooCommerce > Settings > Display > Products go away, and we are left with just one image size.

    I’m sure there is a good reason for this. Would you mind giving me the official low down? Would love to share with my class.

    Thanks so much!

    Angela

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #25157
    Jason Bobich
    Keymaster

    Hi,

    In order for these thumbnails to work properly within the styling of the theme, it is best if they are in the shape of a square. Also, the default images sizes of WooCommerce are too small to accommodate retina/HiDPI styling and fit exactly how I wanted them into the design.

    So I filter the frontend WooCommerce thumbnails to use square sizes that are already within the theme framework. This makes the image size options in WooCommerce not needed, and so I removed them to avoid confusion. This puts all the images into the same system, and they can be now be edited through our framework filters (or Theme Blvd Image Sizes plugin).

    If I didn’t do this, when people install WooCommerce, I would have had to find somewhere to explain all this to the user, and recommend how they should setup their image sizes, and have them regenerate their thumbnails.

    #25166
    askwpgirl
    Participant

    So good to know! I will let everyone know!

    #25218
    askwpgirl
    Participant

    Hi Jason,

    I noticed that the Product Grid for WooCommerce only uses 800×800 images, and there isn’t a way to set a smaller image square in the Theme Options. If the client only has 500×500 images available to them, then you have to use a filter to use a different image size:

    function my_woocommerce_image( $size ) {
         
       $size = 'tb_square_small';
        return $size;
    }
    add_filter( 'themeblvd_woocommerce_thumb_product', 'my_woocommerce_image' );
    

    Let me know if this could be more pithy. Working on teaching hooks on Tuesday and thought this would make good exercise.

    Thanks,

    Angela

    #25219
    askwpgirl
    Participant

    Is the image size set in the WooCommerce Settings even used anywhere? I submitted a separate topic about filtering the sizes. Sorry. Should have just added it here.

    #25223
    Jason Bobich
    Keymaster

    No, the WC setting shouldn’t be used anywhere. But I believe if I’m reading my code right, I put something in there that would allow you to completely turn all of this off, and allow the WC default image sizes and settings to remain.

    add_filter('themeblvd_woocommerce_images', '__return_false');

    Or, yeah you could filter the size used.

    function my_woocommerce_image() {
    	return 'tb_square_small';
    }
    add_filter('themeblvd_woocommerce_thumb_product', 'my_woocommerce_image');

    Or, (what seems most logical to me and why all this exists this way in the first place) is that you’d just edit the image sizes how you would the rest of the images in the theme. You can use the standard filter or the Theme Blvd Image Sizes plugin, as always, and just edit the Medium Square size to be smaller.

    http://dev.themeblvd.com/tutorial/crop-sizes/

    #25226
    askwpgirl
    Participant

    Yeah, I couldn’t see where that one remaining image size in the WooCommerce Display Settings was being used, so I wasn’t sure what I should tell people about that.

    I created a lesson last night to show them how to either use the TB Image Sizes plugin or defining your own image size and using the filter.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.