<?php
/**
 * The template for displaying product content within loops.
 *
 * Override this template by copying it to yourtheme/woocommerce/content-product.php
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $product, $woocommerce_loop, $product_slide_size;

// Store loop count we're currently on
if ( empty( $woocommerce_loop['loop'] ) ) {
	$woocommerce_loop['loop'] = 0;
}

// Store column count for displaying the grid
if ( empty( $woocommerce_loop['columns'] ) ) {
	$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 4 );
}

// Ensure visibility
if ( ! $product || ! $product->is_visible() ) {
	return;
}

if ( !$product_slide_size ) {
	$product_slide_size = 2;
}

// Increase loop count
$woocommerce_loop['loop']++;

// Extra post classes
$classes = array();

$post_classes = 'span' . (int) $product_slide_size . ' product carousel_item';
if ( etheme_product_is_new($product->id) ) {

	$post_classes .= ' new_product';
}

?>

<div <?php post_class($post_classes); ?>>

	<?php do_action( 'woocommerce_before_shop_loop_item' ); ?>

	<div class="product-image-wrapper onhover animate scale">
		<?php etheme_wc_product_labels(); ?>
		<?php do_action( 'etheme_before_shop_loop_item_title' ); ?>

	</div>

	<div class="wrapper-hover">
		<div class="product-name">
			<a href="<?php the_permalink(); ?>">
				<?php the_title(); ?>
			</a>
		</div>

		<?php if ( etheme_get_option('quick_view') ) { ?>
			<a class="quickview img-circle hidden-phone hidden-small-desktop hidden-tablet" data-product-id="<?php echo $product->id; ?>"><?php _e( 'Quick View', 'woocommerce' ); ?></a>
		<?php } ?>

		<div class="wrapper">
			<?php do_action('etheme_after_shop_loop_item_title'); ?>
		</div>

	</div>

	<?php if ( etheme_get_option('isotope_animation') ) {

		$rating = $product->get_average_rating();
		?>

		<span class="sort-date hidden"><?php echo strtotime($product->post->post_date); ?></span>
		<span class="sort-price hidden"><?php echo $product->price; ?></span>
		<span class="sort-product_name hidden"><?php the_title(); ?></span>
		<span class="sort-rating hidden"><?php echo (float) $rating; ?></span>
	<?php } //endif; ?>

</div>

<?php do_action('wft_after_product_carousel_item'); ?>