Issues with Market Press Variant lightbox

I've chatted with you previously about my issues with the lightbox in marketpress. I found a workaround that I think should go into markepress itself.

You can see my issue on https://my.littlefyr.com/omasaromas/store/products/category/aroma/

the lightbox has to scroll vertically.

Then I noticed that the issue goes away when you select a variant.

There is a resize missing in the sequence. Adding this solved my issue:

jQuery(document).bind('cbox_complete', function(){ setTimeout(jQuery.colorbox.resize, 0);});

Just calling resize didn't work;

But that's a little heavy handed. I would think you could add it to:

mp_cart.initProductOptionsLightbox = function() {
        $( '.mp_link-buynow' ).filter( '.mp_button-has_variations' ).colorbox( {
            "close": "x",
            "href": function() {
                return $( this ).attr( 'data-href' );
            },
            "overlayClose": false,
            "trapFocus": false,
            "width": 300,
            "overlayClose": true,
            "escKey": true,
            onLoad: function() {
                $( "#colorbox" ).removeAttr( "tabindex" ); //remove tabindex before select2 init
            },
            onComplete: function() {
               setTimeout($.colorbox.resize, 0);
                $( "select.mp_select2" ).mp_select2( {
                    "dropdownCssClass": "mp_select2",
                    "dropdownAutoWidth": 1,
                    "minimumResultsForSearch": -1
                } );
            }
        } );
    };

or perhaps add an option to the presentation admin page that lets you turn on/off the extra resize.

  • Predrag Dubajic
    • Support

    Hi Adam,

    Glad to hear that you managed to find a solution for this and I would gladly forward this to our developers but I can't replicate this issue on my installation.

    I activated Fixer theme, added a product with variations and added an image to each variation but when I check the product on frontend and open up the lightbox I'm not seeing vertical scroll.
    I tried with and without built-in option in MarketPress but it made no difference.

    Can you tell me if I'm missing any steps here or is there anything I should do differently in order to replicate this issue?

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.