<?php /* Smarty version Smarty-3.1.8, created on 2020-12-10 13:57:52
         compiled from "/home/agmc/beta/application/core/views/frontend/mini/catalog/default/CatalogGridBlock.tpl" */ ?>
<?php /*%%SmartyHeaderCode:18884418895e26c24072d243-42884368%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '0a8b3c67ec0d087ee0baa959d6c9dfb6c8ec3b25' => 
    array (
      0 => '/home/agmc/beta/application/core/views/frontend/mini/catalog/default/CatalogGridBlock.tpl',
      1 => 1605520856,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '18884418895e26c24072d243-42884368',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_5e26c24079eb67_38194633',
  'variables' => 
  array (
    'prodsMaxCount' => 0,
    'resProducts' => 0,
    'toAppend' => 0,
    'resProduct' => 0,
    'uniqueID' => 0,
    'productID' => 0,
    'listLevel' => 0,
    'originCatalogID' => 0,
    'language' => 0,
    'view_public_path' => 0,
    'view_images' => 0,
    'showTitle' => 0,
    'bodystyleparam' => 0,
    'catparam' => 0,
    'urlValue' => 0,
    'brandName' => 0,
    'watchvideoRes' => 0,
    'broucherlink' => 0,
    'languageDirection' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5e26c24079eb67_38194633')) {function content_5e26c24079eb67_38194633($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_replace')) include '/home/agmc/beta/library/template/plugins/modifier.replace.php';
if (!is_callable('smarty_modifier_truncate')) include '/home/agmc/beta/library/template/plugins/modifier.truncate.php';
?><script type="text/javascript">
    var productsCountVar = '<?php echo (($tmp = @$_smarty_tpl->tpl_vars['prodsMaxCount']->value)===null||$tmp==='' ? 0 : $tmp);?>
';
    var lastCatkey       = "<?php echo $_smarty_tpl->tpl_vars['resProducts']->value[count($_smarty_tpl->tpl_vars['resProducts']->value)-1]['catKey'];?>
|default:''";
   
</script>

<?php if ((($tmp = @$_smarty_tpl->tpl_vars['toAppend']->value)===null||$tmp==='' ? '' : $tmp)!='Yes'){?>
<ul class="cateListing list-unstyled gridBg row p-0" id="prodListingUl">
    <?php }?> 
	<div class="videoshow"></div>
    <?php $_smarty_tpl->tpl_vars["categoryKey"] = new Smarty_variable('', null, 0);?>
    <?php  $_smarty_tpl->tpl_vars['resProduct'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['resProduct']->_loop = false;
 $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable;
 $_from = (($tmp = @$_smarty_tpl->tpl_vars['resProducts']->value)===null||$tmp==='' ? array() : $tmp); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['resProduct']->key => $_smarty_tpl->tpl_vars['resProduct']->value){
$_smarty_tpl->tpl_vars['resProduct']->_loop = true;
 $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars['resProduct']->key;
?> 
    <?php $_smarty_tpl->tpl_vars["productID"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['productID'], null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["productOptionsCount"] = new Smarty_variable((($tmp = @$_smarty_tpl->tpl_vars['resProduct']->value['productOptionCount'])===null||$tmp==='' ? '' : $tmp), null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["offerPrice"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['offerPrice'], null, 0);?>
	<?php $_smarty_tpl->tpl_vars["watchvideoRes"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['watchvideoRes'], null, 0);?> 	
    <?php $_smarty_tpl->tpl_vars["productOptionRegularPrice"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['productOptionRegularPrice'], null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["productOptionCashBack"] = new Smarty_variable((($tmp = @$_smarty_tpl->tpl_vars['resProduct']->value['productOptionCashBack'])===null||$tmp==='' ? '' : $tmp), null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["productOptionOfferDiscount"] = new Smarty_variable(round($_smarty_tpl->tpl_vars['resProduct']->value['productOptionOfferDiscount']), null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["productOptionQuantitySum"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['productOptionQuantitySum'], null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["item.freeProductsCount"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['freeProductsCount'], null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["productCurrency"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['productDefaultCurrency'], null, 0);?> 
    <?php $_smarty_tpl->tpl_vars["uniqueID"] = new Smarty_variable((($tmp = @$_smarty_tpl->tpl_vars['uniqueID']->value)===null||$tmp==='' ? '' : $tmp), null, 0);?>

		 <li class="col-12 col-sm-6 col-md-4 col-lg-6 col-xl-4" rel="product_<?php echo $_smarty_tpl->tpl_vars['productID']->value;?>
" uniqueID="<?php echo $_smarty_tpl->tpl_vars['uniqueID']->value;?>
">
        <div class="imageBox bg-white mb-sm-0 mb-3 text-left h-100 d-flex flex-column position-relative">
            <div class="image-thumb position- relative px-3 py-2">
                <figure class="position-relative mb-0">
                    <?php if ((($tmp = @$_smarty_tpl->tpl_vars['listLevel']->value)===null||$tmp==='' ? '' : $tmp)=='3'){?>
                        <?php ob_start();?><?php echo (($tmp = @$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['sef_path'][0][0]->getSefRequestPath($_smarty_tpl->tpl_vars['resProduct']->value['productID'],'product',$_smarty_tpl->tpl_vars['originCatalogID']->value))===null||$tmp==='' ? 0 : $tmp);?>
<?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["urlValue"] = new Smarty_variable($_tmp1, null, 0);?>
                        <?php ob_start();?><?php echo (($tmp = @$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['sef_path'][0][0]->getSefRequestPath($_smarty_tpl->tpl_vars['resProduct']->value['productID'],'product',$_smarty_tpl->tpl_vars['originCatalogID']->value))===null||$tmp==='' ? 0 : $tmp);?>
<?php $_tmp2=ob_get_clean();?><?php echo $_smarty_tpl->smarty->registered_objects['html'][0]->anchor(array('href'=>$_tmp2,'class'=>"d-inline-block w-100",'title'=>$_smarty_tpl->tpl_vars['language']->value['lblViewDetails'],'content'=>"<img class='lazy img-fluid' data-original='".($_smarty_tpl->tpl_vars['view_public_path']->value)."/uploads/catalog/vehicles/thumb/".($_smarty_tpl->tpl_vars['resProduct']->value['productImage'])."' src='".($_smarty_tpl->tpl_vars['view_images']->value)."/loader-small.gif' alt='".($_smarty_tpl->tpl_vars['resProduct']->value['productTitle'])."'>"),$_smarty_tpl);?>

                   <?php }else{ ?>
                      
                       <?php if ((($tmp = @$_smarty_tpl->tpl_vars['listLevel']->value)===null||$tmp==='' ? '' : $tmp)=='1'){?>
                           <?php if ((($tmp = @mb_strtolower($_smarty_tpl->tpl_vars['resProduct']->value['bodyStyle'], 'UTF-8'))===null||$tmp==='' ? '' : $tmp)!='off road'){?>
                                <?php $_smarty_tpl->tpl_vars["showTitle"] = new Smarty_variable((($_smarty_tpl->tpl_vars['resProduct']->value['catName']).(" ")).($_smarty_tpl->tpl_vars['resProduct']->value['bodyStyle']), null, 0);?>
                           <?php }else{ ?>
                               <?php $_smarty_tpl->tpl_vars["showTitle"] = new Smarty_variable($_smarty_tpl->tpl_vars['resProduct']->value['catName'], null, 0);?>
                            <?php }?>
                       <?php }else{ ?>
                            <?php $_smarty_tpl->tpl_vars["showTitle"] = new Smarty_variable(($_smarty_tpl->tpl_vars['resProduct']->value['productShortDescription']), null, 0);?>
                       <?php }?>
                       <?php if ((($tmp = @$_smarty_tpl->tpl_vars['showTitle']->value)===null||$tmp==='' ? '' : $tmp)==''){?>
                           <?php $_smarty_tpl->tpl_vars["showTitle"] = new Smarty_variable(($_smarty_tpl->tpl_vars['resProduct']->value['productTitle']), null, 0);?>                           
                        <?php }?>
                        <?php if ((($tmp = @mb_strtolower($_smarty_tpl->tpl_vars['resProduct']->value['bodyStyle'], 'UTF-8'))===null||$tmp==='' ? '' : $tmp)!='off road'){?>
                             <?php $_smarty_tpl->tpl_vars["urlValue"] = new Smarty_variable("/series/".($_smarty_tpl->tpl_vars['resProduct']->value['catKey'])."/".($_smarty_tpl->tpl_vars['resProduct']->value['bodyStyle'])."/", null, 0);?>
                        <?php }else{ ?>
                             <?php $_smarty_tpl->tpl_vars["urlValue"] = new Smarty_variable("/series/".($_smarty_tpl->tpl_vars['resProduct']->value['catKey'])."/", null, 0);?>                             
                        <?php }?>
                        <?php $_smarty_tpl->tpl_vars["bodystyleparam"] = new Smarty_variable(($_smarty_tpl->tpl_vars['resProduct']->value['bodyStyle']), null, 0);?>
                        <?php if ((($tmp = @$_smarty_tpl->tpl_vars['listLevel']->value)===null||$tmp==='' ? '' : $tmp)=='2'){?>
                            <?php $_smarty_tpl->tpl_vars["catparam"] = new Smarty_variable(($_smarty_tpl->tpl_vars['resProduct']->value['catKey']), null, 0);?>
                            <?php if ((($tmp = @mb_strtolower($_smarty_tpl->tpl_vars['bodystyleparam']->value, 'UTF-8'))===null||$tmp==='' ? '' : $tmp)!='off road'){?>
                                 <?php ob_start();?><?php echo mb_strtolower(smarty_modifier_replace($_smarty_tpl->tpl_vars['bodystyleparam']->value,' ','-'), 'UTF-8');?>
<?php $_tmp3=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["urlValue"] = new Smarty_variable("/series/".($_smarty_tpl->tpl_vars['catparam']->value)."/".$_tmp3."/code/".($_smarty_tpl->tpl_vars['resProduct']->value['bmwCode'])."/", null, 0);?>
                           <?php }else{ ?>
                                 <?php $_smarty_tpl->tpl_vars["urlValue"] = new Smarty_variable("/series/".($_smarty_tpl->tpl_vars['catparam']->value)."/code/".($_smarty_tpl->tpl_vars['resProduct']->value['bmwCode'])."/", null, 0);?>                     
                           <?php }?>
                        <?php }else{ ?>
                            <?php if ((($tmp = @mb_strtolower($_smarty_tpl->tpl_vars['bodystyleparam']->value, 'UTF-8'))===null||$tmp==='' ? '' : $tmp)!='off road'){?>
                                <?php $_smarty_tpl->tpl_vars["urlValue"] = new Smarty_variable("/series/".($_smarty_tpl->tpl_vars['resProduct']->value['catKey'])."/".($_smarty_tpl->tpl_vars['bodystyleparam']->value)."/", null, 0);?>
                           <?php }else{ ?>
                                <?php $_smarty_tpl->tpl_vars["urlValue"] = new Smarty_variable("/series/".($_smarty_tpl->tpl_vars['resProduct']->value['catKey'])."/", null, 0);?>                            
                           <?php }?>
                        <?php }?>
                      <?php echo $_smarty_tpl->smarty->registered_objects['html'][0]->anchor(array('href'=>($_smarty_tpl->tpl_vars['urlValue']->value),'class'=>"d-inline-block w-100",'title'=>$_smarty_tpl->tpl_vars['language']->value['lblViewDetails'],'content'=>"<img class='lazy img-fluid' data-original='".($_smarty_tpl->tpl_vars['view_public_path']->value)."/uploads/catalog/vehicles/thumb/".($_smarty_tpl->tpl_vars['resProduct']->value['productImage'])."' src='".($_smarty_tpl->tpl_vars['view_images']->value)."/loader-small.gif' alt='".($_smarty_tpl->tpl_vars['showTitle']->value)."'>"),$_smarty_tpl);?>

                   <?php }?>
               </figure>
               <?php $_smarty_tpl->tpl_vars["categoryKey"] = new Smarty_variable(($_smarty_tpl->tpl_vars['resProduct']->value['catKey']), null, 0);?>
                <!-- days left ends -->
			 </div>
            <div class="deatils product-info-block px-md-4 px-3 pb-3 text-uppercase"> 
                <?php if ((($tmp = @$_smarty_tpl->tpl_vars['resProduct']->value['financeDesc'])===null||$tmp==='' ? '' : $tmp)!=''&&(($tmp = @$_smarty_tpl->tpl_vars['listLevel']->value)===null||$tmp==='' ? '' : $tmp)=='3'){?>
                    <div class="advantage-label bg-secondary text-white font-xsmall px-lg-4 px-3 py-1 mb-3 text-center">
                    <span class="font-family-secondary offerelement"  style="cursor:pointer;" ><?php echo $_smarty_tpl->tpl_vars['resProduct']->value['financeDesc'];?>
</span></div><p class="offerDesc hide" ><?php echo htmlspecialchars_decode($_smarty_tpl->tpl_vars['resProduct']->value['financeDetailedDesc'], ENT_QUOTES);?>
</p>
					
                <?php }?>
			    <h5 class="productTitle font-weight-semibold mb-3">
                    <?php if ((($tmp = @$_smarty_tpl->tpl_vars['listLevel']->value)===null||$tmp==='' ? '' : $tmp)=='3'){?>
                        <?php ob_start();?><?php echo (($tmp = @$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['sef_path'][0][0]->getSefRequestPath($_smarty_tpl->tpl_vars['resProduct']->value['productID'],'product',$_smarty_tpl->tpl_vars['originCatalogID']->value))===null||$tmp==='' ? 0 : $tmp);?>
<?php $_tmp4=ob_get_clean();?><?php ob_start();?><?php echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['resProduct']->value['productTitle'],45);?>
<?php $_tmp5=ob_get_clean();?><?php echo $_smarty_tpl->smarty->registered_objects['html'][0]->anchor(array('href'=>$_tmp4,'content'=>($_smarty_tpl->tpl_vars['brandName']->value)." ".$_tmp5." (".($_smarty_tpl->tpl_vars['resProduct']->value['modelYear']).")",'class'=>"text-secondary"),$_smarty_tpl);?>

                    <?php }else{ ?>
                        <?php ob_start();?><?php echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['showTitle']->value,45);?>
<?php $_tmp6=ob_get_clean();?><?php echo $_smarty_tpl->smarty->registered_objects['html'][0]->anchor(array('href'=>($_smarty_tpl->tpl_vars['urlValue']->value),'content'=>($_smarty_tpl->tpl_vars['brandName']->value)." ".$_tmp6,'class'=>"text-secondary"),$_smarty_tpl);?>

                    <?php }?>
                </h5>
                <?php if ((($tmp = @$_smarty_tpl->tpl_vars['resProduct']->value['monthlyInstallment'])===null||$tmp==='' ? '' : $tmp)>=0){?>
            <div class="font-normal text-muted">
                <?php echo $_smarty_tpl->tpl_vars['language']->value['lblFinanceEMI'];?>
 <br><span class="font-weight-semibold h5 text-dark"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['price'][0][0]->getFormattedCurrency($_smarty_tpl->tpl_vars['resProduct']->value['monthlyInstallment']);?>
</span></div>
                <?php }?>
                
                <div class="row m-0 pt-1 link-block align-items-center">
                <div class="col-6 p-0 text-left">
                        <?php echo $_smarty_tpl->smarty->registered_objects['html'][0]->anchor(array('href'=>($_smarty_tpl->tpl_vars['urlValue']->value),'class'=>"align-items-center d-flex font-small font-weight-bold py-1 text-capitalize viewDetail",'title'=>$_smarty_tpl->tpl_vars['language']->value['lblViewDetails'],'content'=>"<i class='bg-dark font-weight-bold font-xsmall icon-plus mr-2 rounded-circle text-center text-white'></i>".($_smarty_tpl->tpl_vars['language']->value['lblViewDetails'])),$_smarty_tpl);?>

                </div>
			 	<?php if ((($tmp = @$_smarty_tpl->tpl_vars['listLevel']->value)===null||$tmp==='' ? '' : $tmp)=='2'){?> 
			
                    <div class="col-6 p-0 text-right">
			<?php if (count($_smarty_tpl->tpl_vars['watchvideoRes']->value)>0){?>		
                        <a href="javascript:void(0);" rel="<?php echo $_smarty_tpl->tpl_vars['resProduct']->value['productCategoryID'];?>
" class="openVideopopup font-xl" data-order="0" data-total="5" title="<?php echo $_smarty_tpl->tpl_vars['language']->value['lblWatchVideo'];?>
"><i class="icon-watch-video"></i></a>
            <?php }?>
			   <?php if ($_smarty_tpl->tpl_vars['broucherlink']->value!=''){?> 
					  <a href="" class="ml-2 font-xl"  data-toggle="modal" data-target="#downloadbroucher" title="<?php echo $_smarty_tpl->tpl_vars['language']->value['lblEBrochure'];?>
" download><i class="icon-download-brochure"></i></a> 
                    <?php }?>   
				   </div>
					 <?php }?>
            </div>
            </div>
        </div>
    </li>
	<?php } ?>
	
	<!-- download product information modal -->
    <?php echo $_smarty_tpl->getSubTemplate ("catalog/default/DownloadBroucherForm.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?>

    <!-- download product information modal -->	
<?php if ((($tmp = @$_smarty_tpl->tpl_vars['toAppend']->value)===null||$tmp==='' ? '' : $tmp)!='Yes'){?></ul><?php }?>
<?php if ((($tmp = @$_smarty_tpl->tpl_vars['toAppend']->value)===null||$tmp==='' ? '' : $tmp)!='Yes'&&count((($tmp = @$_smarty_tpl->tpl_vars['resProducts']->value)===null||$tmp==='' ? array() : $tmp))==0){?>
<?php echo $_smarty_tpl->getSubTemplate ('IndexNoProduct.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?>

<?php }?>
<script type="text/javascript">
var $slickElement = $('.video-slider');

$slickElement.on('init reInit afterChange', function(event, slick, currentSlide, nextSlide){
    //currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based)
    var $status = $(this).siblings('.video-slider-count');
    var i = (currentSlide ? currentSlide : 0) + 1;
    $status.text(i + '/' + slick.slideCount);
});

$slickElement.slick({
    arrows:false,
    autoplay: true,
    autoplaySpeed: 4000,
    <?php if ($_smarty_tpl->tpl_vars['languageDirection']->value=="rtl"){?>rtl:true,<?php }?>
});
function videoPopupsliders(intialslide, noofSlides){

    var $videIframeslider = $('.video-iframe-slider');
    
    $videIframeslider.on('beforeChange', function(event, slick, currentSlide, nextSlide){
        $('.slick-current iframe').attr('src', $('.slick-current iframe').attr('src'));
    });

    $videIframeslider.slick({
        arrows:false,
        asNavFor: '.video-iframe-thumbslider',
        <?php if ($_smarty_tpl->tpl_vars['languageDirection']->value=="rtl"){?>rtl:true,<?php }?>
        // initialSlide: intialslide
    });

    $('.video-iframe-thumbslider').slick({
    // infinite: true,
    slidesToShow: 4,
    slidesToScroll: 1,
    asNavFor: '.video-iframe-slider',
    arrows: true,
    centerMode: true,
    focusOnSelect: true,
    centerPadding: '60px',
    prevArrow:"<button type='button' class='icon-arrow-left video-thumb-arrow video-thumb-left'></button>",
    nextArrow:"<button type='button' class='icon-arrow-right video-thumb-arrow video-thumb-right'></button>"
    <?php if ($_smarty_tpl->tpl_vars['languageDirection']->value=="rtl"){?>rtl:true,<?php }?>
    // initialSlide: initial,
    });

    $('.video-iframe-thumbslider').slick('slickGoTo', intialslide, true );
    $videIframeslider.slick('slickGoTo', intialslide, true );
    
}
$(document).on("click", ".openVideopopup", function(){
	var id = $(this).attr("rel");
	$.ajax({
                type: "POST",
                url: GLOBAL_BASE_PATH + "/series/ajaxShowWatchVideo/",
				data: { productCatId: id },
                async: true,
                success: function (data) {
				var tempData = $.parseJSON(data);
				var videores= tempData['videoVals'];
				$(".videoshow").html(videores);
				$(".video-slider-popup").addClass("active");
				$('body').addClass("overflow-hidden");
					var order = $(this).attr('data-order');
					var total = $(this).attr('data-total');
					videoPopupsliders(Number(order), Number(total));				
					//videoPopupsliders(0, 2);				
                    //return false;
                }
            })
	//$(".video-slider-popup"+id).addClass("active");
	//$(this).parents('li').children(".video-slider-popup").addClass("active");
   
});
$(document).on("click", ".openVideopopup1", function(){
		$(".video-slider-popup").addClass("active");
				 $('body').addClass("overflow-hidden")
					var order = $(this).attr('data-order');
					var total = $(this).attr('data-total');
					videoPopupsliders(Number(order), Number(total));				
                   
});
$(document).on("click", ".video-slider-popup-close", function(){
	$(".video-slider-popup").removeClass("active");
    //$(this).parent(".video-slider-popup").removeClass("active");
    $('body').removeClass("overflow-hidden");
	$(".video-iframe-slide iframe").attr("src","");
   // $('.video-iframe-slider').slick('unslick');
    //$('.video-iframe-thumbslider').slick('unslick');
});

$('.offerelement').click(function(){
$(this).parent().next('.offerDesc').toggleClass('hide');
     
  });</script><?php }} ?>