<?php
/**
 * Magiccart 
 * @category 	Magiccart 
 * @copyright 	Copyright (c) 2014 Magiccart (http://www.magiccart.net/) 
 * @license 	http://www.magiccart.net/license-agreement.html
 * @Author: DOng NGuyen<nguyen@dvn.com>
 * @@Create Date: 2016-01-08 22:57:12
 * @@Modify Date: 2018-03-14 23:54:01
 * @@Function:
 */
 ?>
<?php if($this->getStatus() == 2) return; ?>
<?php $selector = 'alo-content-'.rand(0,999999999); ?>
<div class= "<?php /* @escapeNotVerified */ echo $selector?> magicproduct +autoplay">
<?php
$tabs = $this->getTabs();
$numTabs = count($tabs);
if($numTabs): ?>
    <div class="block-title-tabs clearfix hot-deals-tab-time-col">
		<!-- <div class="hot-deals-title"><h2><?php //echo __('Hot Deals') ?></h2></div> -->
		<ul class="magictabs" data-ajax ='<?php /* @escapeNotVerified */ echo $this->getAjaxCfg() ?>'>
		<?php $activated = $this->getTabActivated();
			$limit = $this->getLimit();
			$single = ($numTabs ==1) ? 'single' : '';
			foreach ($tabs as $type => $name):
				$status  = (!$this->getAjax() || $activated ==$type) ? 'loaded' : '';
				$status .= ($type == $activated) ? " activated $single" : '';
				/* @escapeNotVerified */ echo '<li class="item '.$status.'" data-type ="'.$type.'"><span class ="title">'.__($name).'</span></li>';
			endforeach;
		?>
		</ul>
		<?php 
			$timer  = $this->getData('countdown');
			$timer = $timer ?  date('n/d/Y', strtotime($timer)) : 0;
			if($timer) : 
		?>
			<div class="alo-count-down count-down-time">
				<div class="countdown caption" data-timer="<?php /* @escapeNotVerified */ echo $timer ?>"></div>
			</div>
		<?php endif ?>
	</div>
<?php endif ?>
	<div class="row row-eq-height">
		<div class="ajax_loading" style="display:none" data-url="<?php /* @escapeNotVerified */ echo $this->getUrl('magicproduct/index/product', array('_type' => 'direct_link', '_secure'=>$this->getRequest()->isSecure()))?>"></div>
		<div class="col-sm-12 col-md-12 hot-deals-tab-content-col">
			<div class="content-products" 
			<?php foreach ($this->getFrontendCfg() as $opt) :?>
				data-<?php /* @escapeNotVerified */ echo $opt ?>='<?php /* @escapeNotVerified */ echo $this->getData($opt) ?>'
			<?php endforeach;?>        
			>
			<?php 
				$timer = $this->getTimer();
				if($timer) echo $this->getContent('product/gridtimer-countdown.phtml');	
				else echo $this->getContent('product/grid-countdown.phtml');	
			?>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	require([
		'jquery',
		'magiccart/slick',
		'magicproduct'
		], function($, slick, magicproduct){
			$(".<?php echo $selector?>").magicproduct({
				selector : ".<?php echo $selector?>", // Selector product grid
			});
		});
</script>
