0

Variation is not working during Quick view . I made quick view my self . I got all content perfectly. But Variation does not work properly.

script.js

<script>
//Quick View Ajax
jQuery(document).ready(function ($) {
    jQuery('.quickviewButton<?php echo $product->id; ?>').click(function(){
        jQuery('.quickviewButton<?php echo $product->id; ?> i').removeClass('fa-eye');
        jQuery('.quickviewButton<?php echo $product->id; ?> i').addClass('fa-spinner fa-pulse');
        var pid = jQuery(this).attr('data-id');

        jQuery.ajax({
            type: "GET",
            url: pw_script_vars.ajax_url,
            data: {
                pid : pid,
            },
            success: function(data){
                loadVariationScript();
                jQuery.magnificPopup.open({
                    preloader: true,
                    overflowY: 'scroll',
                    items: {
                            src: '<div class="product-quick-view">'+ data + '</div>',
                            type: 'inline'
                        },      // Delay in milliseconds before popup is removed
                    mainClass: 'mfp-fade',
                    });
                jQuery('.quickviewButton<?php echo $product->id; ?> i').removeClass('fa-spinner fa-pulse');
                jQuery('.quickviewButton<?php echo $product->id; ?> i').addClass('fa-eye');
                },
            complete: function(){
                loadVariationScript();
            },
           });
    });
    function loadVariationScript() {
        $.getScript("<?php echo get_site_url();?>/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js");
        $.getScript("<?php echo get_site_url();?>/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.js");
    }
});

  • "does not work" is not a sufficient problem description. – fuxia Jan 30 '17 at 9:26
  • add-to-cart-variation.min.js this js not working when i get single product data via ajax – Vishal Chodvadiya Jan 30 '17 at 10:15
  • I meant variation filtering does not work .. – Vishal Chodvadiya Jan 30 '17 at 10:18
  • First, please do not hide essential information in a comment. :) Second, try to get a debug message, either from the JavaScript console or from your PHP error log. Add both to your question text. – fuxia Jan 30 '17 at 10:20
  • actully i didnot get any bug...I want know how i would the solution of my problem..there are any other option for me to solve my problem or not – Vishal Chodvadiya Jan 30 '17 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.