Product review widget image link - by Airwheeler

This topic has 4 replies, 3 voices, and was last updated 5 years, 4 months ago ago by Olga Barlow

  • Avatar: Airwheeler
    Airwheeler
    Participant
    August 14, 2019 at 08:46

    Hi there,

    I use the product review widget for my main page.

    The image size should be 70 x 70, but it is 555 x 555 and by far to big.
    https://i.imgur.com/3q9bKYt.png

    I have already modified the images and upload it to the wp backend but how I can link to the new image?

    There is no setting available in the widget area, just can set how many reviews will be displayed. https://i.imgur.com/wMCkJox.png

    What is the easiest way to link to the new image destination?

    Thanks in advance…

    https://www.airwheeler.com

    Greetings
    Sebastian

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    August 14, 2019 at 09:26

    Hello,

    The widget takes the size from Appearance > Customize > WooCommerce > Product Images > Thumbnail width
    https://www.8theme.com/documentation/xstore/woocommerce/product-images/

    Regards

    Avatar: Airwheeler
    Airwheeler
    Participant
    August 14, 2019 at 14:32

    Hallo,

    thx for the quick respond, but my qustion was is it possible only modify the the widget images.

    If I do like you say all my product images would be more small and wouldn`t fit with my webshop any more.

    Any other solution?

    Greetings
    Sebastian

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 14, 2019 at 15:42

    Hello,

    We use the default WooCommerce function to show image there. If you want to customize widgets then copy xstore/woocommerce/content-widget-product.php and xstore/woocommerce/content-widget-reviews.php to child theme, find code
    <?php echo $product->get_image(); ?>
    and replace by
    <?php echo get_the_post_thumbnail( $product->get_id(), 'woocommerce_gallery_thumbnail' ); ?>
    http://prntscr.com/osmlrk

    You’ll get the WooComerce gallery size 100×100 instead of the shop thumbnail. In case you want to change also the gallery size then add the following code to child theme functions.php

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

    Don’t forget to regenerate thumbnails after these changes to apply the new size.

    Regards

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.