<div class="product">
<?php
/*
if ( ! defined( 'ABSPATH' ) ) exit; //Exit if accessed directly
*/
wp_reset_query();
global $product, $woocommerce_loop;
$related = $product->get_related( $posts_per_page );
if ( sizeof( $related ) != 0 ){
$args = apply_filters( 'woocommerce_related_products_args', array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'no_found_rows' => 1,
'posts_per_page' => 5,
'orderby' => $orderby,
'post__in' => $related,
'post__not_in' => array( $product->id )
) );
$products = new WP_Query( $args );
$woocommerce_loop['columns'] = $columns;
if ( $products->have_posts() ) : ?>
<?php while ( $products->have_posts() ) : $products->the_post(); ?>
<div class="item">
<a><?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" width="120px" height="120px" />'; ?></a>
<label class="lable"><a class="link" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></label><br />
<label class="lable"><a class="green" href="<?php the_permalink(); ?>"><i class="livicon" data-n="inbox-in" data-s="20" data-c="white" data-hc="#e74c3c" data-a="1" data-l="0" data-i="3" data-d="0" data-et="hover" data-op="0" data-onparent="true"></i></a>
<a href="<?php the_permalink(); ?>" class="red"><i class="livicon" data-n="eye-open" data-s="20" data-c="black" data-hc="#e74c3c" data-a="1" data-l="0" data-i="3" data-d="0" data-et="hover" data-op="0" data-onparent="true"></i></a>
</label>
</div>