Ejemplo n.º 1
0
<?php

/**
 * Single Product Image
 *
 * @author 		YIThemes
 * @package 	YITH_Magnifier/Templates
 * @version     1.0.0
 */
global $post, $woocommerce, $product, $yith_wcmg;
$columns = floor(yiw_shop_large_w() / (yiw_shop_thumbnail_w() + 18));
$enable_slider = (bool) (get_option('yith_wcmg_enableslider') == 'yes' && count($product->get_gallery_attachment_ids()) + 1 > $columns);
?>


<div class="images">
	
	<?php 
if (!yith_wcmg_is_enabled()) {
    ?>

		
		<!-- Default Woocommerce Template -->
		<?php 
    if (has_post_thumbnail()) {
        ?>

	
			<a itemprop="image" href="<?php 
        echo wp_get_attachment_url(get_post_thumbnail_id());
        ?>
<?php

/**
 * Single Product Image
 *
 * @author 		YIThemes
 * @package 	YITH_Magnifier/Templates
 * @version     1.0.0
 */
global $post, $product, $woocommerce;
$columns = apply_filters('woocommerce_product_thumbnails_columns', get_option('yith_wcmg_slider_items', floor(yiw_shop_large_w() / (yiw_shop_thumbnail_w() + 18))));
$attachment_ids = $product->get_gallery_attachment_ids();
// add featured image
if (!empty($attachment_ids)) {
    array_unshift($attachment_ids, get_post_thumbnail_id());
}
$enable_slider = (bool) (get_option('yith_wcmg_enableslider') == 'yes' && count($attachment_ids) + 1 > $columns);
if (empty($attachment_ids)) {
    return;
}
?>

<div class="thumbnails<?php 
echo $enable_slider ? ' slider' : ' noslider';
?>
"><?php 
echo '<ul class="yith_magnifier_gallery">';
$loop = 0;
foreach ($attachment_ids as $attachment_id) {
    $classes = array();
    if ($loop == 0 || $loop % $columns == 0) {