Home Forums Basel support forum Thumbnail issue on WC mails

Thumbnail issue on WC mails

Viewing 30 posts - 1 through 30 (of 36 total)
  • Author
    Posts
  • #94716

    Giulio
    Participant

    Hi there, after last Basel update (with last WC version) our thumbnails inside WooCommerce mails are corrupted. There is something wrong with this:

    <img width=”70″ height=”70″
    src=”image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gODIK/9sAQwAGBAQFBAQGBQUFBgYGBwkOCQkICAkSDQ0KDhUSFhYVEhQUFxohHBcYHxkUFB0nHR8iIyUlJRYcKSwoJCshJCUk/9sAQwEGBgYJCAkRCQkRJBgUGCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQk/8AAEQgACgAKAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+oJ5mjuYwGG08Fcdf1qzUMkaNMrMilh0JHNTUkB//9k=”
    class=”attachment-70×70 size-70×70 basel-lazy-load
    basel-lazy-fade” alt=”Puro Talco profumo di nicchia di
    Officina delle Essenze” style=”border-radius: 3px; padding:
    0; margin: 0;”>

    I took this from a source code of a mail. Could you please give us a suggestion? Thanks a lot.

    #94718

    Artem Temos
    Keymaster

    Hi,

    There is no image in WooCommerce emails by default. How did you add it there?

    Regards

    #94719

    Giulio
    Participant

    We always used a plugin called Email Customizer. And it always worked with WooCommerce.

    #94724

    Artem Temos
    Keymaster

    It seems to be a conflict of this plugin with our lazy loading feature. We will try to find a workaround in our next theme update.

    #94737

    Giulio
    Participant

    Please could you suggest me a workaround also without the update? We’re receiving many orders and all our E-Mails are without thumbnails.

    #94925

    Artem Temos
    Keymaster

    Sorry, but there is no a quick fix for this. We will need more time to investigate the plugin functionality and try to find a fix.

    #94984

    Giulio
    Participant

    Damn 😕 With the previous Basel version it worked. Do you think that I could fix it temporarily with the exchanging the a php file?

    #95038

    Artem Temos
    Keymaster

    Most likely, you didn’t use the lazy loading before since we didn’t change anything with it.

    #95044

    Artem Temos
    Keymaster

    What plugin do you use to add the thumbnail? Please, send us a link.

    #95048

    Giulio
    Participant
    #95077

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function basel_lazy_loading_init( $force_init ) {
    	if ( ( ( ! basel_get_opt( 'lazy_loading' ) || is_admin() ) && ! $force_init ) ) {
    		return;
    	}
    
    	// Used for product categories images for example.
    	add_filter('basel_attachment', 'basel_lazy_attachment_replace', 10, 3);
    
    	// Used for instagram images.
    	add_filter('basel_image', 'basel_lazy_image_standard', 10, 1);
    
    	// Used for avatar images.
    	add_filter( 'get_avatar', 'basel_lazy_avatar_image', 10 );
    
    	// Images generated by WPBakery functions
    	add_filter('vc_wpb_getimagesize', 'basel_lazy_image', 10, 3);
    
    	// Products, blog, a lot of other standard wordpress images
    	add_filter('wp_get_attachment_image_attributes', 'basel_lazy_attributes', 10, 3);
    
    }
    
    add_action( 'init', 'basel_lazy_loading_init', 120 );
    
    function basel_lazy_loading_deinit( $force_deinit = false ) {
    	if ( basel_get_opt( 'lazy_loading' ) && ! $force_deinit ) {
    		return;
    	}
    
    	remove_filter( 'basel_attachment', 'basel_lazy_attachment_replace', 10, 3) ;
    	remove_filter( 'get_avatar', 'basel_lazy_avatar_image', 10 );
    	remove_filter( 'basel_image', 'basel_lazy_image_standard', 10, 1 );
    	remove_filter( 'vc_wpb_getimagesize', 'basel_lazy_image', 10, 3 );
    	remove_filter( 'wp_get_attachment_image_attributes', 'basel_lazy_attributes', 10, 3 );
    }
    
    add_action( 'woocommerce_email_before_order_table', function(){
    	basel_lazy_loading_deinit(true);
    }, 20 );
    
    add_action( 'woocommerce_email_after_order_table', function(){
    	basel_lazy_loading_init(true);
    }, 20 );
    #95079

    Giulio
    Participant

    I tried to active the snippet, but Code Snippet plugin stop the activation. Maybe something miss to complete the snippet? It prevented an error 500.

    #95093

    Artem Temos
    Keymaster

    Where did you place the code? Could you please send us a screenshot?

    #95109

    Giulio
    Participant

    The code is exactly that one that you pasted to me.

    #95131

    Artem Temos
    Keymaster

    Which PHP version do you use on your server? Please, check also PHP error logs and send us this error.

    #95138

    Giulio
    Participant

    We’re using the 7.2 of PHP. Is it compatible? The error log is empty on the server and also on FTP. The Siteground support told us that it is probably an issue related to php version. What do you think about it?

    #95181

    Artem Temos
    Keymaster

    Yes, the code works fine with PHP 7.2. Could you try to add it directly to the child theme functions.php file via FTP?

    #95185

    Giulio
    Participant

    Done. The web site works! I’ll wait for another order to let you know something.

    #95217

    Artem Temos
    Keymaster

    OK, waiting for further information.

    #95239

    Giulio
    Participant

    Hey, it’s working again! We’re happy. Do you will insert the snippet inside the next Basel version?

    #95319

    Artem Temos
    Keymaster

    Watch our changelog. We will try to fix this in our theme core.

    #168143

    Giulio
    Participant

    Hello there again! We have the same issue, this time not with Basel, but WoodMart. How can we fix it in this case? Please take a look to the screenshots. Thanks!

    #168255

    Artem Temos
    Keymaster

    Hello,

    Yes, you the same code but replace all basel prefixes with woodmart.

    Kind Regards

    #168353

    Giulio
    Participant

    Thanks a lot. We’re testing your advice.

    #183407

    Giulio
    Participant

    Hello,

    I re-open this ticket because it is the same thread, but 2 years after. For a period of time we did not use Basel lazy load – preferring WP-Rocket lazy load – but now we’re starting again, because we moved to a Litespeed server.

    So with Basel we’re having new issues with the lazy load and some follow up mails from WooCommerce Follow Ups plugin. In the screenshot below you can see that our customers can’t see anymore the thumbnails. Take also a look to the related source code please.

    The fix could be try to exclude the lazy load from there?

    Thanks a lot.

    #183484

    Artem Temos
    Keymaster

    Hello,

    Does it happen with the plugin’s emails only? Please, check how standard WooCommerce emails work.

    Kind Regards

    #183498

    Giulio
    Participant

    It happen also without the plugin that customize the CSS of the WooCommerce mails 😕

    #183540

    Artem Temos
    Keymaster

    Have you added the code to the child theme? https://xtemos.com/forums/topic/thumbnail-issue-on-wc-mails/#post-95077
    Please, send us a screenshot. Also, be sure that you are running the latest version of the theme.

    #183670

    Giulio
    Participant

    The theme is running with the last version, so please don’t worry about that.

    Just one question: if I see well the snippet do more than what we need. Our issues is related only to the lazy load with product images that appears on the follow ups mails.

    Could you tell us the specific code for our case? Thanks.

    #183727

    Artem Temos
    Keymaster

    Do you mean that it happen with the plugin’s emails only? Have you tested how standard WooCommerce emails work? (like new order)

Viewing 30 posts - 1 through 30 (of 36 total)