<?php if ($module_position == 'content_top'  or $module_position == 'content_bottom') { ?>

<section id="latest-products" class="box">

	<div class="box-heading"><?php echo $heading_title; ?></div>

	<div class="box-content">
		
		<div class="box-product row-fluid">

			<?php 
			
			$counter = 0;
			
			foreach ($products as $product) { 
				
				if (($counter+2) % 4 == 0) $xclass="odd";
				else if (($counter+4) % 4 == 0 ) $xclass="alpha";
				else $xclass="";

			?>

			<div class="span3 grid-box <?php echo $xclass; ?>">

				<div class="inner">

					<?php if ($product['thumb']) { ?>
					<div class="image">
						<a href="<?php echo $product['href']; ?>">
							<img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" />
						</a>
					</div>
					<?php } ?>

					<div class="name">
						<a href="<?php echo $product['href']; ?>">
							<?php echo $product['name']; ?>
						</a>
					</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/themeglobalpro/images/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
					</div>
					<?php } ?>

					<div class="cart">
						<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="btn btn-cart btn-small" />
					</div>

				</div>

			</div> <!-- .span3 -->

			<?php $counter++; } ?>

		</div> <!-- .box-product -->

	</div> <!-- .box-content -->

</section>

<?php } else if ($module_position == 'column_left' or $module_position == 'column_right') { ?>  
	
	<div class="box-left">
		
		<div class="box-heading"><?php echo $heading_title; ?></div>
	
			<div class="box-content">
    
				<div class="box-product-left">
					
					<?php foreach ($products as $product) { ?>
						
						<div>
							
							<?php if ($product['thumb']) { ?>
        
								<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
							
							<?php } ?>
        
							<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></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/themeglobalpro/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
        
							<?php } ?>
						</div>
					
					<?php } ?>
    
				</div>
			
			</div>
	
	</div>

               
 <?php } ?>