<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>

  <?php if ($products) { ?>
  <div class="product-filter">
    <div class="display"><span class="<?php echo $text_list; ?>"><?php echo $text_list; ?></span><span class="<?php echo $text_grid; ?>"><a onclick="display('grid');"><?php echo $text_grid; ?></a></span></div>
    <div class="limit"><?php echo $text_limit; ?>
      <select onchange="location = this.value;">
        <?php foreach ($limits as $limits) { ?>
        <?php if ($limits['value'] == $limit) { ?>
        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
    <div class="sort"><span><?php echo $text_sort; ?></span>
      <select onchange="location = this.value;">
        <?php foreach ($sorts as $sorts) { ?>
        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
	<div class="product-compare"><a href="<?php echo $compare; ?>" id="compare-total"><?php echo $text_compare; ?></a></div>
  </div>

<div class="product-grid-list">
  <ul class="product-list" id="product-list-grid">
    <?php foreach ($products as $product) { ?>
    <li>
	<div class="product-block pro<?php echo $product['product_id']; ?>">
	<input type="hidden" name="product_idhidden" class="product_idhidden" id="product_idhidden" value="<?php echo $product['product_id']; ?>"/>
	<input type="hidden" name="product_carrinho" class="product_carrinho" id="product_carrinho<?php echo $product['product_id']; ?>" value="<?php echo $product['productcart'] ?>"/>
        <input type="hidden" name="parhidden" class="parhidden" id="parhidden" value="acc"/>
	<div class="product-block-inner">

  <div style="width:88px; float:left;">
  <input type="button" id="decrease_<?php echo $product['product_id']; ?>" value="-"  onclick="javascript:onAction('<?php echo $product['product_id']; ?>', -1, 'acc');" style="width:20px; text-indent:0px;" />
  <input style="width:35px" type="text" name="quantity" id="htopacc_<?php echo $product['product_id']; ?>" size="2" value="1" class="numeric" />
  <input type="button" id="increase_<?php echo $product['product_id']; ?>" value="+" onclick="javascript:onAction('<?php echo $product['product_id']; ?>', 1, 'acc');" style="width:20px; text-indent:0px;"/>
  <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
  </div>
  <div class="cart">
		<button name="button" onclick="addCarrinho('<?php echo $product['product_id']; ?>', 'acc');"></button>
  </div>

	<?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 } ?>

	    <div class="saleblock">
	  	<?php if (!$product['special']) { ?>
		<?php } else { ?>
		<span class="saleicon sale">Sale</span>
		<?php } ?>
		</div>

	  <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>

	  <div class="description"><?php echo $product['description']; ?></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 } ?>
        <?php if ($product['tax']) { ?>
        <br />
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></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 } ?>
      <div class="cart">
		<button name="button" onclick="addCarrinho('<?php echo $product['product_id']; ?>', 'af');"></button>
		</div>
      <div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>
  </div>
 </div>

    </li>
    <?php } ?>
  </ul>
</div>
  <div class="pagination"><?php echo $pagination; ?></div>
  <?php } ?>
  <?php if (!$categories && !$products) { ?>
  <div class="content"><?php echo $text_empty; ?></div>
  <div class="buttons">
  <div class="right"><a href="<?php echo $continue; ?>" class="button"><?php echo $button_continue; ?></a></div>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript" src="catalog/view/javascript/megnor/listgrid.js"></script>

<?php if ($this->config->get('config_status_analytics_avancado')){ ?>
<script type="text/javascript">
  $(document).ready(function() {
    var analyticsProdutos = <?php echo json_encode($products);?>;
    analyticsAddImpressao(analyticsProdutos, 'categorias');
  });
</script>
<?php } ?>

<?php echo $footer; ?>
