Home Forums WoodMart support forum Problem with Quick View and PopUp

Problem with Quick View and PopUp

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #68573

    newsprince
    Participant

    Hello.

    If you add Products (Grid or Carousel) widget with visual composer and click Quick View, you can select variations – color and size for example – and it will see the inventory stock for the selected product.

    If you add the same widget Products (Grid or Carousel) inside PopUp widget, click the button of the popup and then select quick view from a product. The quick view does not see the inventory and you can free select as much quantity as you like.

    You can check the url on the private section.

    Thank you.

    #68592

    Hello,

    Please deactivate Include minified JS and Combine JS files.

    Then find the function quickViewLoad in woodmart/js/functions.js and replace the code with this one:

    woodmartThemeModule.quickViewLoad = function (id, btn, prev, next, closeText, loadingText) {
            var data = {
                id: id,
                action: "woodmart_quick_view"
            };
    
            $.ajax({
                url: woodmart_settings.ajaxurl,
                data: data,
                method: 'get',
                success: function (data) {
                    // Open directly via API
                    $.magnificPopup.close();
                    setTimeout(function () {
                        $.magnificPopup.open({
                            items: {
                                src: '<div class="mfp-with-anim popup-quick-view">' + data + '</div>', // can be a HTML string, jQuery object, or CSS selector
                                type: 'inline'
                            },
                            tClose: closeText,
                            tLoading: loadingText,
                            removalDelay: 500, //delay removal by X to allow out-animation
                            callbacks: {
                                beforeOpen: function () {
                                    this.st.mainClass = woodmartTheme.popupEffect + ' quick-view-wrapper';
                                },
                                open: function () {
                                    $('.variations_form').each(function () {
                                        $(this).wc_variation_form().find('.variations select:eq(0)').change();
                                    });
                                    $('.variations_form').trigger('wc_variation_form');
                                    $('body').trigger('woodmart-quick-view-displayed');
                                    woodmartThemeModule.swatchesVariations();
    
                                    woodmartThemeModule.btnsToolTips();
                                    setTimeout(function () {
                                        woodmartThemeModule.nanoScroller();
                                    }, 300);
                                }
                            },
                        });
                    }, 500)
    
                },
                complete: function () {
                    btn.removeClass('loading');
                },
                error: function () {
                },
            });
        };

    Best Regards

    #68599

    newsprince
    Participant

    Yes now it works.

    Will you implement the fix on future version? Or we have to apply it in every update?

    Thank you.

    #68602

    Artem Temos
    Keymaster

    We will try to prepare some general fix for this in our future updates. But maybe you will need to keep it for next few updates.

    #80901

    newsprince
    Participant

    Hello.

    The problem exists also in version 3.

    Are you planing to fix this? Just to know.

    Thank you very much.

    #80937

    Artem Temos
    Keymaster

    We can’t add it into core, unfortunately. Keep this fix until the next update. And then, put this simple line to the child theme functions.php file

    add_filter( 'woodmart_quickview_in_popup_fix', '__return_true' );

    #81156

    newsprince
    Participant

    Thank you very much.

    So to understand correctly. On next update i will not have to edit the functions.js file.
    I would have to just add this filter you posted to my child themes functions.php ?

    Thank you.

    #81158

    Artem Temos
    Keymaster

    Exactly 🙂

Viewing 8 posts - 1 through 8 (of 8 total)