<div class="box">
  <div class="box-heading"><i class="fa fa-arrow-right" style="margin-right:8px; "></i><a href="<?php echo $latest; ?>" title="<?php echo $text_latest_msg; ?>"><?php echo $heading_title; ?></a></div>
  <div class="box-content">
 <!-- Megnor Start-->
	<?php
		$sliderFor = 4;
		$productCount = sizeof($products);
	?>
	<?php if ($productCount >= $sliderFor): ?>
		<div class="customNavigation">
			<a class="btn prev"><i class="fa fa-chevron-left" style="font-size:18px;"></i></a>
			<a class="btn next"><i class="fa fa-chevron-right" style="font-size:18px;"></i></a>
		</div>
	<?php endif; ?>
    <div class="box-product <?php if ($productCount >= $sliderFor){?>product-carousel<?php }else{?>productbox-grid<?php }?>" id="<?php if ($productCount >= $sliderFor){?>latest-carousel<?php }else{?>latest-grid<?php }?>">
<!-- Megnor End-->
      <?php foreach ($products as $product) { ?>
	  <div class="<?php if ($productCount >= $sliderFor){?>slider-item<?php }else{?>product-items<?php }?>">
	 <?php
        $borda3 = "";
		if($product['productcart']){
			$borda3 = "border-color: #00a550;";
		};
	  ?>
	  <div class="product-block pro<?php echo $product['product_id']; ?>" style="<?php echo $borda3 ?> min-height:350px;">
	  <div class="product-block-inner">

        <?php if ($product['thumb'] == '') { ?>
			<div class="image"><a href="<?php echo $product['href']; ?>"><img src="image/data/sem-imagem.png"  title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
			<?php } else { ?>
			<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>"  title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
			<?php } ?>
		<?php if (!$product['special']) { ?>
		<?php } else { ?>
		<span class="saleicon sale">Sale</span>
		<?php } ?>

        <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
        <div class="modelo">Código: <?php echo $product['model']; ?>  </div>
        <?php if ($product['price']) { ?>
        <div class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
          <?php } ?>
        </div>
        <?php } ?>
        <?php if ($product['rating']) { ?>
        <div class="rating"><img src="catalog/view/theme/<?php echo $this->config->get('config_template') ?>/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
        <?php } ?>
        <?php
			$divmod = "lasted";
			?>
			<div class="base-produto-atacado" style="width:180px;">
			<div class="content-produto-atacado" style="width:80px; float:left;">
			<input type="button" id="decrease_<?php echo $product['product_id']; ?>" value="-" onclick="javascript:onAction('<?php echo $product['product_id']; ?>', -1, 'af');">
			<input type="text" name="quantity" class="input_qtd numeric" value="1" id="htopaf_<?php echo $product['product_id']; ?>">
			<input type="button" id="increase_<?php echo $product['product_id']; ?>" value="+" onclick="javascript:onAction('<?php echo $product['product_id']; ?>', 1, 'af');">
			<input type="hidden" name="product_id" size="2" value="<?php echo $product['product_id']; ?>" />
			</div>
			<div class="cart">
			<button name="button" onclick="addCarrinho('<?php echo $product['product_id']; ?>', 'af');"></button>
			</div>
			</div>
      </div>
	  </div>
	  </div>
      <?php } ?>
    </div>
  </div>
</div>
<span class="latest_default_width" style="display:none; visibility:hidden"></span>
