From 282489a2f0896261944af0c67b01eb78f46a51e3 Mon Sep 17 00:00:00 2001 From: Jason King Date: Fri, 14 Apr 2017 20:24:14 +0930 Subject: [PATCH] Woocommerce 3.0.0 Support --- .../single-product/product-thumbnails.php | 66 ++++++------------- 1 file changed, 21 insertions(+), 45 deletions(-) diff --git a/woocommerce/single-product/product-thumbnails.php b/woocommerce/single-product/product-thumbnails.php index 4d944a3..ace91d0 100644 --- a/woocommerce/single-product/product-thumbnails.php +++ b/woocommerce/single-product/product-thumbnails.php @@ -1,7 +1,7 @@ get_gallery_attachment_ids(); +$attachment_ids = $product->get_gallery_image_ids(); -if ( $attachment_ids ) { - $loop = 0; - $columns = apply_filters( 'woocommerce_product_thumbnails_columns', 3 ); - ?> -
$image_title, + '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], + ); - $classes = array( 'zoom' ); + $html = ''; - if ( $loop === 0 || $loop % $columns === 0 ) { - $classes[] = 'first'; - } - - if ( ( $loop + 1 ) % $columns === 0 ) { - $classes[] = 'last'; - } - - $image_class = implode( ' ', $classes ); - $props = wc_get_product_attachment_props( $attachment_id, $post ); - - if ( ! $props['url'] ) { - continue; - } - - echo apply_filters( - 'woocommerce_single_product_image_thumbnail_html', - sprintf( - '%s', - esc_url( $props['url'] ), - esc_attr( $image_class ), - esc_attr( $props['caption'] ), - wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ), 0, $props ) - ), - $attachment_id, - $post->ID, - esc_attr( $image_class ) - ); - - $loop++; - } - - ?>
-