Question

I am using Weltpixel Quick View extension and it is working fine.But there is an issue when products loads using infinite scroll.After loads products using infinite scroll , quick view stops working.There is an issue related to the JS function.Can you guys let me know which quick function i have to use in the infinite scroll JS file?

This is my URL: http://45.56.70.30/pospaper/thermal-paper-rolls/all-thermal-paper.html You can check from here.Once the products loads , quick view stops working.

I am using Strategy Infinite Scroll. https://github.com/Strategery-Inc/Magento2-InfiniteScroll This infinite scroll also working fine.

Infintie scroll Js file path:

https://github.com/Strategery-Inc/Magento2-InfiniteScroll/blob/master/view/frontend/web/js/infinitescroll.js

Weltpixel Quick View JS file

http://45.56.70.30/pospaper/weltpixel_quickview.js

This is the script which used in phtml file.

<script>
    requirejs(['jquery', 'weltpixel_quickview' ],
        function   ($, quickview) {
            $(document).ready(function() {
                $('.weltpixel-quickview').bind('click', function() {
                    var prodUrl = $(this).attr('data-quickview-url');
                    if (prodUrl.length) {
                        quickview.displayContent(prodUrl);
                    }
                });
            });
        });

    window.weltpixel_quickview = {"baseUrl":"http:\/\/45.56.70.30\/pospaper\/","closeSeconds":"5","showMiniCart":"1","showShoppingCheckoutButtons":"0"};
</script>
Was it helpful?

Solution

I am also using infinite scroll on category pages and search result page. I have managed to work by changing the following file:

app/code/WeltPixel/Quickview/view/frontend/templates/initialize.phtml

Replacing the whole code with below code:

<?php
// @codingStandardsIgnoreFile

/** @var $block \WeltPixel\Quickview\Block\Initialize */
?>
<script>
    requirejs(['jquery', 'weltpixel_quickview' ],
        function   ($, quickview) {
            $(document).ready(function() {
                $('#maincontent').on('click', '.weltpixel-quickview', function() {
                    var prodUrl = $(this).attr('data-quickview-url');
                    if (prodUrl.length) {
                        quickview.displayContent(prodUrl);
                    }
                });
            });
        });

    window.weltpixel_quickview = <?php /* @escapeNotVerified */ echo \Zend_Json::encode($block->getConfig()); ?>;
</script>

OTHER TIPS

  1. First I installed the Scroll.
  2. After that the Quickview with that changing.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top