A
A
Artem-subbotin2018-03-26 08:52:42
WordPress
Artem-subbotin, 2018-03-26 08:52:42

Why fuzzy images in Woocommerce store?

Help me understand why and how to fix a bug with product images
https://amico-hc.com/shop/
Some product images look fuzzy when viewed from a phone or tablet (everything is ok on a desktop).
All images are the same size. And I can’t understand the logic why some are OK, while others are blurry. Tried loading different extensions, etc. The problem is not solved in any way.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Shilov, 2018-03-26
@Olivoin

It seems to me that the problem is in the adaptive tag and how woocommerce distributes which image to which device to give.
If we are talking only about thumbnails in the product cycle, then the easiest way is to overwrite their output:

function woocommerce_template_loop_product_thumbnail(){
    $product_img = get_the_post_thumbnail_url();
    echo '
        <div class="product-image" style="background-image:url(' . $product_img . ');"></div>
    ';
}

In this code, I display the thumbnail as a background, it’s easier for me personally to manage the appearance later, you just specify the height to the parent, and , product-image: background-size: contain - and all the business

A
Artem-subbotin, 2018-03-26
@Artem-subbotin

Added code, but now all images are gone:
joxi.ru/MAjZJBNUvMpo1A

O
Orkhan Hasanli, 2018-03-27
@azerphoenix

Hello!
1) check the Wocomerc version and update if necessary
2) update your theme's Wocomerc templates
3) check your theme's Wocomerc templates and see what thumbnails are being returned.
4) regenerate thumbnails by setting regenerate thumbnails maybe you just changed the theme and forgot to regenerate thumbnails.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question