<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use Magento\Framework\App\Action\Action;

?>
<?php
/**
 * Product list template
 *
 * @var $block \Magento\Catalog\Block\Product\ListProduct
 * @var \Magento\Framework\Escaper $escaper
 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
 */
?>
<?php
$_productCollection = $block->getLoadedProductCollection();
/** @var \Magento\Catalog\Helper\Output $_helper */
$_helper = $block->getData('outputHelper');
$themeHelper = $this->helper('MGS\ThemeSettings\Helper\Config');

$lazyLoad = $themeHelper->getStoreConfig('themesettings/general/lazy_load');
$baseImage = $this->getViewFileUrl('MGS_ThemeSettings::images/blank.png');
$baseImageHover = $this->getViewFileUrl('MGS_ThemeSettings::images/blank.png');
$settings = $themeHelper->getThemeSettings();
$perrow = $settings['catalog']['per_row'];

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
if ($category && !empty($category->getPerRow())) {
    $perrow = $category->getPerRow();
}

$colCheck = $themeHelper->convertPerRowtoCol($perrow);
$colClass = $themeHelper->convertColClass($colCheck, 'col', null);

/* Theme config */
$_hideReview = $themeHelper->getStoreConfig('themesettings/catalog/review');
$_hideAddCart = $themeHelper->getStoreConfig('themesettings/catalog/add_to_cart');
$_hideWishlist = $themeHelper->getStoreConfig('themesettings/catalog/wishlist_button');
$_hideCompare = $themeHelper->getStoreConfig('themesettings/catalog/compare_button');
$callHelper = $this->helper('MGS\Callforprice\Helper\Data');
$test = $this->getLayout()->createBlock('MGS\Callforprice\Block\RequestQuote')->getFormAction();
/** @var \Magento\Customer\Model\Session $customerSession */
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get(\Magento\Customer\Model\Session::class);
$UrlInterface = $objectManager->get(\Magento\Framework\UrlInterface::class);
?>
<?php if (!$_productCollection->count()): ?>
    <div class="message info empty">
        <div><?= $escaper->escapeHtml(__('We can\'t find products matching the selection.')) ?></div>
    </div>
<?php else: ?>
    <div class="category-product-actions">
        <div class="filter-toggle">
            <a href="javascript:void(0)" class="title">
                <span class="icon pe-7s-edit"></span>
            </a>
        </div>
        <?= $block->getAdditionalHtml() ?>
        <?= $block->getToolbarHtml() ?>
    </div>
    <?php
    if ($block->getMode() == 'grid') {
        $viewMode = 'grid';
        $imageDisplayArea = 'category_page_grid';
        $image_hover = 'product_thumbnail_image';
        $showDescription = false;
        $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
    } else {
        $viewMode = 'list';
        $imageDisplayArea = 'category_page_list';
        $image_hover = 'product_thumbnail_image';
        $showDescription = true;
        $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::FULL_VIEW;
    }
    /**
     * Position for actions regarding image size changing in vde if needed
     */
    $pos = $block->getPositioned();
    ?>
    <div class="products wrapper mgs-products <?= /* @noEscape */
    $viewMode ?> products-<?= /* @noEscape */
    $viewMode ?>">
        <ol class="products list items product-items">
            <?php $_imageHelper = $this->helper('Magento\Catalog\Helper\Image'); ?>
            <?php $size = $themeHelper->getImageSize(); ?>
            <?php $padding = $themeHelper->getImagePadding(); ?>
            <?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); ?>
            <?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
            <?php if ($block->getMode() == 'grid'): ?>
                <?php $i = 0; ?>
                <?php foreach ($_productCollection as $_product): $i++; ?>
                    <?php $productThumbnail = $_product->getData('thumbnail'); ?>
                    <li class="item product <?= $themeHelper->getClearClass($perrow,
                        $i) ?> product-item-info product-item <?php echo $colClass ?>">
                        <?php $_productNameStripped = $block->stripTags($_product->getName(), null, true); ?>
                        <?php $productImage = $_imageHelper->init($_product, $imageDisplayArea)
                            ->resize($size['width'], $size['height'])->getUrl(); ?>
                        <?php $productImageHover = $_imageHelper->init($_product, $image_hover)
                            ->resize($size['width'], $size['height'])->getUrl(); ?>
                        <?php if (!$lazyLoad): ?>
                            <?php $baseImage = $productImage ?>
                            <?php $baseImageHover = $productImageHover ?>
                        <?php endif ?>
                        <div class="product-top">
                            <a href="<?php echo $_product->getProductUrl() ?>"
                               style="padding-bottom: <?php echo $padding; ?>;"
                               class="product photo product-item-photo <?php if ($productThumbnail &&
                                   (basename($productThumbnail) != 'no_selection') && (basename($productThumbnail) !=
                                       basename($_product->getData('small_image')))): ?> has-hover-image<?php endif ?>"
                               tabindex="-1">
                                <img src="<?php echo $baseImage ?>" alt="<?php echo $_productNameStripped ?>"
                                     class="img-responsive product-image-photo img-thumbnail<?php if ($lazyLoad): ?> arrow-lazy<?php endif ?>"
                                     data-src="<?php echo $productImage ?>"/>

                                <?php if ($productThumbnail && basename($productThumbnail) != 'no_selection'): ?>
                                    <?php if (basename($productThumbnail) !=
                                        basename($_product->getData('small_image'))): ?>
                                        <img src="<?php echo $baseImageHover ?>"
                                             alt="<?php echo $_productNameStripped ?>"
                                             class="img-responsive img-hover-show<?php if ($lazyLoad): ?> arrow-lazy<?php endif ?>"
                                             data-src="<?php echo $productImageHover ?>"/>
                                    <?php endif ?>
                                <?php endif ?>

                                <div class="product-image-photo"></div>
                            </a>
                            <!-- Product label-->
                            <?php echo $themeHelper->getProductLabel($_product); ?>
                            <?php if (!$_hideWishlist || !$_hideCompare): ?>
                                <ul data-role="add-to-links" class="actions-link actions-secondary">
                                    <?php if ($addToBlock = $block->getChildBlock('addto')): ?>
                                        <?= $addToBlock->setProduct($_product)->getChildHtml() ?>
                                    <?php endif; ?>
                                </ul>
                            <?php endif ?>
                            <?php if ($_product->isSaleable() && !$_hideAddCart): ?>
                                <div class="action-mobile">
                                    <?php $postParams = $block->getAddToCartPostParams($_product); ?>
                                    <form data-role="tocart-form"
                                          data-product-sku="<?= $escaper->escapeHtml($_product->getSku()) ?>"
                                          action="<?= $escaper->escapeUrl($postParams['action']) ?>"
                                          method="post">
                                        <input type="hidden"
                                               name="product"
                                               value="<?= /* @noEscape */
                                               $postParams['data']['product'] ?>">
                                        <input type="hidden"
                                               name="<?= /* @noEscape */
                                               Action::PARAM_NAME_URL_ENCODED ?>"
                                               value="<?=
                                               /* @noEscape */
                                               $postParams['data'][Action::PARAM_NAME_URL_ENCODED]
                                               ?>">
                                        <?= $block->getBlockHtml('formkey') ?>
                                        <button type="submit"
                                                title="<?= $escaper->escapeHtmlAttr(__('Add to Cart')) ?>"
                                                class="action tocart btn-cart primary ">
                                            <span class="icon pe-7s-shopbag"></span>
                                            <span class="text"><?= $escaper->escapeHtml(__('Add to Cart')) ?></span>
                                        </button>
                                    </form>
                                </div>
                            <?php endif; ?>
                        </div>
                        <div class="product details product-item-details">
                            <?php
                            $_productNameStripped = $block->stripTags($_product->getName(), null, true);
                            ?>
                            <h5 class="product name product-item-name">
                                <a class="product-item-link"
                                   href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>">
                                    <?= /* @noEscape */
                                    $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
                                </a>
                            </h5>

                            <?php if (!$_hideReview): ?>
                                <?= $block->getReviewsSummaryHtml($_product, $templateType, true) ?>
                            <?php endif; ?>


                            <?php $postParams = $block->getAddToCartPostParams($_product); ?>
                            <?php if (!$callHelper->getConfig('mgscallforprice/general/isenabled')) : ?>
                                <?= /* @noEscape */
                                $block->getProductPrice($_product) ?>
                            <?php else: ?>
                                <?php if ($callHelper->getConfig('mgscallforprice/general/choosetype') == '1') : ?>
                                    <a href="tel: <?php echo $callHelper->getConfig('mgscallforprice/general/vendorphonenumber') ?>"
                                       class="callforprice btn btn-default btn-xs tocart"><span><i
                                                class="pe-7s-call"></i><?php echo $callHelper->getConfig('mgscallforprice/general/callforpricetextbutton') ?></span></a>
                                <?php elseif ($callHelper->getConfig('mgscallforprice/general/choosetype') == '2'): ?>
                                    <button type="button" class=" tocart request-quote-<?php echo
                                    $_product->getId(); ?>">
                                        <span><?php echo $callHelper->getConfig('mgscallforprice/general/requestquote') ?></span>
                                    </button>
                                    <form class="form quote-request test" action="<?php echo $test; ?>"
                                          id="quote-request-form-<?php echo $_product->getId() ?>" method="post"
                                          data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>"
                                          data-mage-init='{"validation":{}}' style="display: none;">
                                        <fieldset class="fieldset">
                                            <legend class="legend">
                                                <span><?= $block->escapeHtml(__('Write Us')) ?></span></legend>
                                            <br/>
                                            <div class="field note no-label">
                                                <?= $block->escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?>
                                            </div>
                                            <div class="field name required">
                                                <label class="label"
                                                       for="name"><span><?= $block->escapeHtml(__('Name')) ?></span></label>
                                                <div class="control">
                                                    <input name="name" id="name-<?php echo $_product->getId(); ?>"
                                                           title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value=""
                                                           class="input-text"
                                                           type="text" data-validate="{required:true}"/>
                                                </div>
                                            </div>
                                            <div class="field telephone">
                                                <label class="label"
                                                       for="telephone"><span><?= $block->escapeHtml(__('Phone Number')) ?></span></label>
                                                <div class="control">
                                                    <input name="telephone"
                                                           id="telephone-<?php echo $_product->getId(); ?>"
                                                           title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>"
                                                           value=""
                                                           class="input-text" type="text"/>
                                                </div>
                                            </div>
                                            <div class="field email required">
                                                <label class="label"
                                                       for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
                                                <div class="control">
                                                    <input name="email" id="email-<?php echo $_product->getId(); ?>"
                                                           title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value=""
                                                           class="input-text" type="email"
                                                           data-validate="{required:true, 'validate-email':true}"/>
                                                </div>
                                            </div>

                                            <div class="field productId">
                                                <label class="label productId"
                                                       for="productId"><span><?= $block->escapeHtml(__('Product ID')) ?></span></label>
                                                <div class="control">
                                                    <input name="productId"
                                                           id="productId-<?php echo $_product->getId(); ?>"
                                                           title="<?= $block->escapeHtmlAttr(__('Product ID')) ?>"
                                                           value="<?php echo $_product->getId(); ?>" class="input-text"
                                                           type="hidden"
                                                           readonly="readonly"/>
                                                </div>
                                            </div>
                                            <div class="field productSku">
                                                <label class="label productSku"
                                                       for="productSku"><span><?= $block->escapeHtml(__('Product SKU')) ?></span></label>
                                                <div class="control">
                                                    <input name="productSku"
                                                           id="productSku-<?php echo $_product->getId(); ?>"
                                                           title="<?= $block->escapeHtmlAttr(__('Product SKU')) ?>"
                                                           value="<?php echo $_product->getSku(); ?>" class="input-text"
                                                           type="hidden"
                                                           readonly="readonly"/>
                                                </div>
                                            </div>
                                            <div class="field productName">
                                                <label class="label productName"
                                                       for="productName"><span><?= $block->escapeHtml(__('Product Name')) ?></span></label>
                                                <div class="control">
                                                    <input name="productName"
                                                           id="productName-<?php echo $_product->getId(); ?>"
                                                           title="<?= $block->escapeHtmlAttr(__('Product Name')) ?>"
                                                           value="<?php echo $_product->getName(); ?>"
                                                           class="input-text" type="hidden"
                                                           readonly="readonly"/>
                                                </div>
                                            </div>
                                            <div class="field comment">
                                                <label class="label" for="comment">
                                                    <span><?= $block->escapeHtml(__('Comment')) ?></span>
                                                </label>
                                                <div class="control">
															<textarea name="comment"
                                                                      id="comment-<?php echo $_product->getId(); ?>"
                                                                      title="<?= $block->escapeHtmlAttr(__('Comment')) ?>"
                                                                      class="input-text" cols="5" rows="3"></textarea>
                                                </div>
                                            </div>
                                            <?= $block->getChildHtml('form.additional.info') ?>
                                        </fieldset>
                                        <div class="actions-toolbar">
                                            <div class="primary">
                                                <input type="hidden" name="hideit" id="hideit" value=""/>
                                                <button type="submit"
                                                        title="<?= $block->escapeHtmlAttr(__('Submit')) ?>"
                                                        class="action submit primary">
                                                    <span><?= $block->escapeHtml(__('Submit')) ?></span>
                                                </button>
                                            </div>
                                        </div>
                                    </form>
                                <?php else: ?>
                                    <?php if (!$customerSession->isLoggedIn()): ?>
                                        <a href="<?= $UrlInterface->getUrl('customer/account/login') ?>"
                                           alt="Login to see price" class="logintoseeprice">
                                            <span><?= __('Login to see price') ?></span>
                                        </a>
                                    <?php else: ?>
                                        <?= /* @noEscape */
                                        $block->getProductPrice($_product) ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                            <?php endif; ?>
                            <?php if ($_product->isAvailable()): ?>
                                <?= $block->getProductDetailsHtml($_product) ?>
                            <?php endif; ?>
                        </div>
                    </li>
                <?php endforeach; ?>
            <?php else: ?>
                <?php foreach ($_productCollection as $_product): ?>
                    <?php $productThumbnail = $_product->getData('thumbnail'); ?>
                    <li class="item product product-item-info product-item">
                        <div class="line">
                            <div class="col-des-3 col-tb-4 col-mb-12">
                                <div class="product-image-content">
                                    <?php $_productNameStripped = $block->stripTags($_product->getName(), null,
                                        true); ?>
                                    <?php $productImage = $_imageHelper->init($_product, $imageDisplayArea)
                                        ->resize($size['width'], $size['height'])->getUrl(); ?>
                                    <?php $productImageHover = $_imageHelper->init($_product, $image_hover)
                                        ->resize($size['width'], $size['height'])->getUrl(); ?>
                                    <?php if (!$lazyLoad): ?>
                                        <?php $baseImage = $productImage ?>
                                        <?php $baseImageHover = $productImageHover ?>
                                    <?php endif ?>
                                    <a href="<?php echo $_product->getProductUrl() ?>"
                                       style="padding-bottom: <?php echo $padding; ?>;"
                                       class="product photo product-item-photo <?php if ($productThumbnail &&
                                           (basename($productThumbnail) != 'no_selection') &&
                                           (basename($productThumbnail) !=
                                               basename($_product->getData('small_image')))): ?> has-hover-image<?php endif ?>"
                                       tabindex="-1">
                                        <img src="<?php echo $baseImage ?>" alt="<?php echo $_productNameStripped ?>"
                                             class="img-responsive product-image-photo img-thumbnail<?php if ($lazyLoad): ?> arrow-lazy<?php endif ?>"
                                             data-src="<?php echo $productImage ?>"/>

                                        <?php if ($productThumbnail &&
                                            basename($productThumbnail) != 'no_selection'): ?>
                                            <?php if (basename($productThumbnail) !=
                                                basename($_product->getData('small_image'))): ?>
                                                <img src="<?php echo $baseImageHover ?>"
                                                     alt="<?php echo $_productNameStripped ?>"
                                                     class="img-responsive img-hover-show<?php if ($lazyLoad): ?> arrow-lazy<?php endif ?>"
                                                     data-src="<?php echo $productImageHover ?>"/>
                                            <?php endif ?>
                                        <?php endif ?>

                                        <div class="product-image-photo"></div>
                                    </a>

                                    <!-- Quick view-->
                                    <ul class="mgs-quickview actions-secondary"></ul>
                                    <!-- Product label-->
                                    <?php echo $themeHelper->getProductLabel($_product); ?>
                                </div>
                            </div>
                            <div class="col-des-9 col-tb-8 col-mb-12">
                                <div class="product details product-item-details">
                                    <?php
                                    $_productNameStripped = $block->stripTags($_product->getName(), null, true);
                                    ?>
                                    <h5 class="product name product-item-name">
                                        <a class="product-item-link"
                                           href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>">
                                            <?= /* @noEscape */
                                            $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
                                        </a>
                                    </h5>
                                    <?php if (!$_hideReview): ?>
                                        <?= $block->getReviewsSummaryHtml($_product, $templateType, true) ?>
                                    <?php endif ?>
                                    <?= /* @noEscape */
                                    $block->getProductPrice($_product) ?>
                                    <?php if ($showDescription): ?>
                                        <div class="product description product-item-description">
                                            <?= /* @noEscape */
                                            $_helper->productAttribute(
                                                $_product,
                                                $_product->getShortDescription(),
                                                'short_description'
                                            ) ?>
                                        </div>
                                    <?php endif; ?>
                                    <ul class="actions-link">
                                        <li>
                                            <?php if ($_product->isSaleable() && !$_hideAddCart): ?>
                                                <?php $postParams = $block->getAddToCartPostParams($_product); ?>
                                                <form data-role="tocart-form"
                                                      data-product-sku="<?= $escaper->escapeHtml($_product->getSku()) ?>"
                                                      action="<?= $escaper->escapeUrl($postParams['action']) ?>"
                                                      method="post">
                                                    <input type="hidden"
                                                           name="product"
                                                           value="<?= /* @noEscape */
                                                           $postParams['data']['product'] ?>">
                                                    <input type="hidden"
                                                           name="<?= /* @noEscape */
                                                           Action::PARAM_NAME_URL_ENCODED ?>"
                                                           value="<?=
                                                           /* @noEscape */
                                                           $postParams['data'][Action::PARAM_NAME_URL_ENCODED]
                                                           ?>">
                                                    <?= $block->getBlockHtml('formkey') ?>
                                                    <button type="submit"
                                                            title="<?= $escaper->escapeHtmlAttr(__('Add to Cart')) ?>"
                                                            class="action tocart primary btn-cart">
                                                        <span class="icon pe-7s-shopbag"></span>
                                                        <span
                                                            class="text"><?= $escaper->escapeHtml(__('Add to Cart')) ?></span>
                                                    </button>
                                                </form>
                                            <?php endif; ?>
                                        </li>
                                        <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() &&
                                            !$_hideWishlist): ?>
                                            <li>
                                                <button
                                                    data-title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
                                                    class="action towishlist"
                                                    title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
                                                    aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
                                                    data-post='<?php /* @escapeNotVerified */
                                                    echo $block->getAddToWishlistParams($_product); ?>'
                                                    data-action="add-to-wishlist"
                                                    role="button">
                                                    <i class="pe-7s-like"></i>
                                                </button>
                                            </li>
                                        <?php endif; ?>

                                        <?php if (!$_hideCompare): ?>
                                            <li>
                                                <button
                                                    data-title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
                                                    class="action tocompare"
                                                    title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
                                                    aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
                                                    data-post='<?php /* @escapeNotVerified */
                                                    echo $compareHelper->getPostDataParams($_product); ?>'
                                                    role="button">
                                                    <i class="pe-7s-graph3"></i>
                                                </button>
                                            </li>
                                        <?php endif ?>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ol>
    </div>
    <div class="bottom-pagination">
        <?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?>
    </div>

    <?php if (!$block->isRedirectToCartEnabled()): ?>
        <script type="text/x-magento-init">
        {
            "[data-role=tocart-form], .form.map.checkout": {
                "catalogAddToCart": {
                    "product_sku": "<?= $escaper->escapeJs($_product->getSku()) ?>"
                }
            }
        }


        </script>
    <?php endif; ?>
<?php endif; ?>
<script>
    require([
        'jquery',
        'waypoints'
    ], function(jQuery){
        (function($) {
            $('.filter-toggle .title').on('click', function(){
                $('html').toggleClass('filter-open');
            });
        })(jQuery);
    });

</script>
<script type="text/javascript">

    requirejs([
        'require',
        'jquery',
        'mgsmasonry',
        'mgsvisible'
    ], function( require, $, Masonry) {
        require( [ 'bridget' ], function( jQueryBridget ) {

            jQueryBridget( 'masonry', Masonry, $ );

            $(window).on('load', function() {
                var $container = $('.product-list-masonry-change-product').masonry({
                    itemSelector: '.product-item-masonry',
                    columnWidth: '.product-item-masonry',
                    horizontalOrder: true,
                    initLayoutMasonry: false
                });

                $('.layout-mode-button-group').on( 'click', 'a', function() {
                    $container.masonry({
                        columnWidth: '.product-item-masonry',
                        maxHeight: 0,
                        initLayoutMasonry: false
                    });

                });

                // change is-checked class on buttons
                $('.button-group').each( function( i, buttonGroup ) {
                    var $buttonGroup = $( buttonGroup );

                    $buttonGroup.on( 'click', 'a', function() {
                        $buttonGroup.find('.is-checked').removeClass('is-checked');
                        $( this ).addClass('is-checked');
                    });

                });

            });

            $(document).ajaxComplete(function() {
                var $container = $('.product-list-masonry-change-product').masonry({
                    itemSelector: '.product-item-masonry',
                    columnWidth: '.product-item-masonry',
                    horizontalOrder: true,
                    initLayoutMasonry: true
                });

                $('.layout-mode-button-group').on( 'click', 'a', function() {
                    $container.masonry({
                        columnWidth: '.product-item-masonry',
                        maxHeight: 0,
                        initLayoutMasonry: false
                    });

                });

                // change is-checked class on buttons
                $('.button-group').each( function( i, buttonGroup ) {
                    var $buttonGroup = $( buttonGroup );
                    $buttonGroup.on( 'click', 'a', function() {
                        $buttonGroup.find('.is-checked').removeClass('is-checked');
                        $( this ).addClass('is-checked');
                    });

                });
                $(window).on('scroll', function(){
                    $(".product-list-masonry-change-product > .product-item-masonry").each(function(){
                        if($(this).visible(true,true,'vertical')) {
                            $(this).addClass('enable');
                        }else {
                            $(this).removeClass('enable');
                        }
                    });
                });

            });

        });

    });


</script>
<script type="text/javascript">
    require(["jquery", "Magento_Ui/js/modal/modal"],function($, modal) {
		<?php foreach ($_productCollection as $_product): ?>
			var options = {
            type: 'popup', // popup or slide
			responsive: true, // true = on smaller screens the modal slides in from the right
			modalClass: 'see-detail-modal',
			};
			$(".request-quote-<?php echo $_product->getId() ?>").on('click',function() {
				$('#quote-request-form-<?php echo $_product->getId() ?>').modal(options).modal('openModal');
			});
		<?php endforeach; ?>
    });

</script>
