<?php 
global $product;
?>
<div class="swg-product-gallery woocommerce-product-gallery woocommerce-product-gallery--with-images style1">
	<div class="woocommerce-product-gallery__wrapper">
	<?php do_action( 'swg_single_product_gallery_before_slider' ); ?>
	<?php
		$attachments = $product->get_gallery_image_ids();
		if( has_post_thumbnail() ){ 	
			$image_id	= get_post_thumbnail_id( $product->get_id() );
			array_unshift( $attachments, $image_id );
			$attachments = array_unique( $attachments );
		}
		if( sizeof( $attachments ) ){	
			foreach ( $attachments as $key => $attachment ) { ?>
			<div data-thumb="<?php echo wp_get_attachment_image_url( $attachment, 'shop_thumbnail' ) ?>" class="woocommerce-product-gallery__image">	
				<a href="<?php echo wp_get_attachment_url( $attachment ) ?>">
					<?php 
					if( wp_get_attachment_image( $attachment, 'shop_single' ) ){
						$full_size_image  = wp_get_attachment_image_src( $attachment, 'full' );
						$attributes = array(
							'class' => 'wp-post-image',
							'title'                   => get_post_field( 'post_title', $attachment ),
							'data-caption'            => get_post_field( 'post_excerpt', $attachment ),
							'data-src'                => $full_size_image[0],
							'data-large_image'        => $full_size_image[0],
							'data-large_image_width'  => $full_size_image[1],
							'data-large_image_height' => $full_size_image[2],
						);
						echo wp_get_attachment_image( $attachment, 'shop_single', false, $attributes ); 
					}else{
						echo  wc_placeholder_img( 'shop_single' );
					}
					?>
				</a>
			</div>
			<?php } ?>		
	<?php }	?>
	</div>
</div>