A Listorne
A Listorne

Reputation: 27

How can I display my original product images instead of the ones generated by woocomerce?

how can I display my original product images instead of the ones generated by woocommerce? (My products images are much much smaller in size, but the ones generated by woocommerce are almost the double in size)

So in the products shop page I would like to use the original ones instead, as well as in the main page, category page, search page, and the rest of the pages.

Thank you so much

Upvotes: 0

Views: 3250

Answers (1)

Rajeev
Rajeev

Reputation: 1488

I understand your query but this is not advisable to use the Full-size image in all the places as it will make a huge impact in Performance.

Refer the below link which explains about the Hooks which can be used for changing the Image size of Woocommerce products.

https://docs.woocommerce.com/document/image-sizes-theme-developers/

The below code will change the image size to Full for Shop Page, Sub Category Page, Single Gallery Thumbnail and Single Gallery Main Image.

function rf_product_thumbnail_size( $size ) {
    global $product;

    $size = 'full';
    return $size;
}
add_filter( 'single_product_archive_thumbnail_size', 'rf_product_thumbnail_size' );
add_filter( 'subcategory_archive_thumbnail_size', 'rf_product_thumbnail_size' );
add_filter( 'woocommerce_gallery_thumbnail_size', 'rf_product_thumbnail_size' );
add_filter( 'woocommerce_gallery_image_size', 'rf_product_thumbnail_size' );

Upvotes: 5

Related Questions