Support » Plugin: Woocommerce Gift Wrapper » No Option showing up

  • Dear author,

    first of all, thank you for this great idea. Sadly I don’t get it work. I read the documentation and set up everything. Nevertheless, nothing happens. I tried to show the notification in all combinations but really nothing happens.

    I use Woodmart and Germanized. Do you have any idea to make it work or to check, where the problem might be?

    Thanks a lot and best regards,
    iRomeK

    The page I need help with: [log in to see the link]

Viewing 4 replies - 16 through 19 (of 19 total)
  • Plugin Author Little Package

    (@littlepackage)

    You can turn it off now.

    So, I don’t write specifically for Woodmart, because it’s a very complex theme and I have no relationship, so here’s what you need to do.

    Woodmart is adding classes and attributes to the popup thumbnails, in fact EVERY image on your site, using the ‘wp_get_attachment_image_attributes’ WordPress hook.

    Here’s Woodmart’s pluggable function:

    function woodmart_lazy_attributes($attr, $attachment, $size) {
    
        $attr['data-wood-src'] = $attr['src'];
        if( isset( $attr['srcset'] ) ) $attr['data-srcset'] = $attr['srcset'];
    		
        if ( is_object( $attachment ) ) {
    	$attr['src'] = woodmart_get_attachment_placeholder( $attachment->ID, $size );
        }
    		
        $attr['srcset'] = '';
    
        $attr['class'] = $attr['class'] . ' ' . woodmart_lazy_css_class();
        
        return $attr;
    }

    Which causes this:

    <img src="/wp-content/uploads/2021/01/Verpackung-150x150.jpg" class="attachment-thumbnail size-thumbnail woodmart-lazy-load woodmart-lazy-fade woodmart-loaded" alt="Verpackung" loading="lazy" srcset="/wp-content/uploads/2021/01/Verpackung-150x150.jpg 150w, https://website.com/wp-content/uploads/2021/01/Verpackung-100x100.jpg 100w" sizes="(max-width: 150px) 100vw, 150px" data-wood-src="/wp-content/uploads/2021/01/Verpackung-150x150.jpg" data-srcset="/wp-content/uploads/2021/01/Verpackung-150x150.jpg 150w, https://website.com/wp-content/uploads/2021/01/Verpackung-100x100.jpg 100w" width="150" height="150">

    You don’t want this on modals (which stop scrolling behavior needed for lazyload), so you need to speak with your developer or Woodmart to arrange a workaround. Perhaps adding a class or attribute to the image tag using the Gift Wrapper modal template (templates/wcgwp/modal.php) will allow you to re-write the pluggable function to look for that class or attribute and stop Woodmart’s long spiny fingers from getting into EVERYTHING. Or maybe Woodmart’s lazy load can look for modal opening as well as scroll events. Gift Wrapper uses a Vanilla JS Modal.

    You’ve got a pretty nice site! Just a little more TLC will get you there.

    • This reply was modified 7 months ago by Little Package. Reason: remove tags from code
    Plugin Author Little Package

    (@littlepackage)

    You could also use Javascript to load lazy images on modal opening, something like this: https://stackoverflow.com/a/48401731

    I’ve provided you with a LOT of information, some valuable clues, and I urge you to discuss your options with your developer.

    Thread Starter iromek

    (@iromek)

    Thank you very much for your time and these informations. I will give all this information to my developer!

    And thank you for the kind words! šŸ™‚

    When I found a solution, I will post it here!

    5 Starts for support!

    Plugin Author Little Package

    (@littlepackage)

    Hi @iromek

    I’m curious, have you heard anything further about this plugin/theme issue? Any resolution? Please let us know if you have time. Thank you.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘No Option showing up’ is closed to new replies.