<?php
/**
 *
 * SM CartQuickPro - Version 1.0.0
 * Copyright (c) 2017 YouTech Company. All Rights Reserved.
 * @license - Copyrighted Commercial Software
 * Author: YouTech Company
 * Websites: http://www.magentech.com
 */

if (!(int)$this->_getConfig('isenabled', 1))
    return;

?>

<script>
    require([
        'jquery',
        'quickView',
        'domReady!'
    ], function ($, cartQuickView) {
        var quickViewCf = {
            isQuickView: <?php echo $this->_isQuickView() ? 'true' : 'false'; ?>,
            isAjaxCart: <?php echo $this->_isAjaxCart() ? 'true' : 'false'; ?>,
            product_container: '<?php echo $this->_getConfig('product_container'); ?>',
            button_container: '<?php echo $this->_getConfig('button_container'); ?>',
            label_button: '<?php echo $this->_getConfig('label_button'); ?>',
            base_url: '<?php echo $this->getUrl();?>'
        }
        $(quickViewCf.product_container).cartQuickView(quickViewCf);
        $(document).on("afterAjaxProductsLoaded", function (event) {
            $(quickViewCf.product_container).cartQuickView(quickViewCf);
        });
    });
</script>	