Tagged: woocommerce widget
I have the recently viewed products list widget on the single product pages. The images are randomly the wrong size (too small so blurry) and occasionally correct. I have used a lot of css to remove things like shopping cart, etc. that is not needed. Wondering if I have a conflict. The css goes back to 2013 although the problem is new.
Hey ricedean,
Thanks for the link to your site, the Recently Viewed Products widget show smaller image typically 36px square and should have a layout like this:
but it looks like you are using some custom css to show the small images larger, so the are blurry:
To correct this try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function larger_recently_viewed_products_widget_images() { ?>
<script>
(function($){
$('.single-product .widget_recently_viewed_products').each(function(){
$('.product_list_widget img.size-widget').attr('width', '250px');
$('.product_list_widget img.size-widget').attr('height', '250px');
$('.product_list_widget img.size-widget').attr('sizes', '(max-width: 450px) 100vw, 450px');
});
})(jQuery);
</script>
<?php
}
add_action( 'wp_footer', 'larger_recently_viewed_products_widget_images', 99 );
This will change the image size used to a larger image so they won’t be blurry
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
Mike
That worked. Thank You!
Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike