woocommerce issues
-
Hi,
thanks for great plugin, but it’s not working with woocommerce.When I set custom size for main image or gallery images then it will load always full image instead…
I also tried to use .skip-lazy
add_filter( 'woocommerce_gallery_image_html_attachment_image_params', 'nolazy_woo_images', 10, 4 ); function nolazy_woo_images( $atts, $attachment_id, $image_size, $main_image ){ $atts['class'] .= ' skip-lazy'; return $atts; }When I deactivate your plugin then correct image is loaded.
eg. correct one is
https://XXX/wp-content/uploads/2020/01/cheese-1-732x514.jpg
but your plugin ignore .skip-lazy and load full image
https://XXX/wp-content/uploads/2020/01/cheese-1.jpgHtml from source code (ctrl+u) is same, but Inspect element (F12) is different:
with A3 lazy:
<img width="732" height="514" src="https://XXX/wp-content/uploads/2020/01/cheese-1.jpg" class="wp-post-image skip-lazy lazy-loaded" alt="" title="cheese-1" data-caption="" data-src="https://XXX/wp-content/uploads/2020/01/cheese-1.jpg" data-large_image="https://XXX/wp-content/uploads/2020/01/cheese-1.jpg" data-large_image_width="780" data-large_image_height="818" draggable="false">
without A3 lazy:
<img width="732" height="514" src="https://XXX/wp-content/uploads/2020/01/cheese-1-732x514.jpg" class="wp-post-image skip-lazy" alt="" title="cheese-1" data-caption="" data-src="https://XXX/wp-content/uploads/2020/01/cheese-1.jpg" data-large_image="https://XXX/wp-content/uploads/2020/01/cheese-1.jpg" data-large_image_width="780" data-large_image_height="818" draggable="false">Can you fix this please? It’s probably because WOO use data-src attribute by default?
The topic ‘woocommerce issues’ is closed to new replies.