<?php
if(!$this->getEnabled()) return;
$selector = 'alo-content-'.rand(0,999999999);
$brands = $this->getBrands();
if(!count($brands)) return;
?>
<div class="<?php /* @escapeNotVerified */ echo $selector ?>">
    <?php /* @escapeNotVerified */ echo $this->getTitle() ? '<h2 class="title item">' . '<span>' . $this->getTitle() . '</span>' . '</h2>' : '' ?>
    <div class="shopbrand"
    <?php foreach ($this->getFrontendCfg() as $opt) :?>
        data-<?php /* @escapeNotVerified */ echo $opt ?>='<?php /* @escapeNotVerified */ echo $this->getData($opt) ?>'
    <?php endforeach;?>  
    >
        <?php $i=0; foreach ($brands as $brand) :?>
			<div class="item">
				<a href="<?php /* @escapeNotVerified */ echo $this->getUrlBrand($brand) ?>">
					<img class="brand img-responsive" src="<?php /* @escapeNotVerified */ echo $this->getImage($brand)?>" alt="<?php /* @escapeNotVerified */ echo __($brand->getTitle()) ?>" title="<?php /* @escapeNotVerified */ echo __($brand->getTitle()) ?>" />
				</a>
			</div>
        <?php endforeach ?>
    </div>
</div>
<script type="text/javascript">
    require([
        'jquery',
        'magiccart/slick',
        'alothemes',
        ], function($, slick, alothemes){
            var shopbrand  = $('.<?php echo $selector ?> .shopbrand');
            if(shopbrand.length) $('head').append(magicproduct(shopbrand, '.item'));
    });
</script>
