ID ), 'full' );
$image = $thumb_image[0];
$image_sizes = $image_dimension['width'];
$i = 0;
$srcset = wp_get_attachment_image_srcset( get_post_thumbnail_id( $post->ID ) );
$srcset_attr = !empty( $srcset ) ? 'srcset="' . $srcset . '"' : '';
$image = '
![' . esc_attr( get_the_title( get_post_thumbnail_id( $post->ID ) ) ) . '](' . esc_url( $image ) . ')
';
echo '
';
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $image, $post->ID, $post->ID );
echo '
';
preg_match( '@src="([^"]+)"@', $image, $match );
$src = array_pop( $match );
$processed_images[] = $src;
}
// variation images
if ( $product->is_type( 'variable' ) ) {
$k=1;
foreach ( $variable_images as $key => $variable_image ) {
// crop variable Image
$variable_url = $variable_image;
if ( in_array( $variable_url, $processed_images ) ) {
continue;
}
$processed_images[] = $variable_url;
$img_alt="";
echo '
';
echo '
![' . ( ( $img_alt = get_the_title( attachment_url_to_postid( $variable_url ) ) ) ? esc_attr( $img_alt ) : '' ) . '](' . esc_url( $variable_url ) . ')
';
echo '
';
$k++;
$k = $k++;
}$k = $k;
foreach ( $attachment_ids as $attachment_id ) {
if ( array( 'is_quick_view' => true ) ) {
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ) );
} else {
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'gallery_thumbnail' ) );
}
preg_match( '@src="([^"]+)"@', $image, $match );
$src = array_pop( $match );
if ( in_array( $src, $processed_images ) ) {
continue;
}
$processed_images[] = $src;
echo '
';
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $image, $attachment_id, $post->ID );
echo '
';
$k++;
}
}
$j = 1;
if(!$product->is_type( 'variable' )){
foreach ( $attachment_ids as $attachment_id ) {
if ( array( 'is_quick_view' => true ) ) {
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ) );
} else {
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'gallery_thumbnail' ) );
}
preg_match( '@src="([^"]+)"@', $image, $match );
$src = array_pop( $match );
if ( in_array( $src, $processed_images ) ) {
continue;
}
$processed_images[] = $src;
echo '
';
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $image, $attachment_id, $post->ID );
echo '
';
$j++;
}}
?>