diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 6b2fa169f4f..d5318741413 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -1477,13 +1477,16 @@ if ( ! function_exists( 'woocommerce_show_product_images' ) ) { function woocommerce_show_product_images() { global $product; $post_thumbnail_id = $product->get_image_id(); + $gallery_image_ids = ''; + if ( ! $post_thumbnail_id ) { $gallery_image_ids = $product->get_gallery_image_ids(); if ( ! empty( $gallery_image_ids ) ) { $post_thumbnail_id = array_shift( $gallery_image_ids ); } } - wc_get_template( 'single-product/product-thumbnails.php', array( 'post_thumbnail_id' => $post_thumbnail_id ) ); + $args = compact( 'post_thumbnail_id', 'gallery_image_ids' ); + wc_get_template( 'single-product/product-image.php', $args ); } } if ( ! function_exists( 'woocommerce_show_product_thumbnails' ) ) { diff --git a/templates/single-product/product-image.php b/templates/single-product/product-image.php index 26407bc902b..303de05c349 100644 --- a/templates/single-product/product-image.php +++ b/templates/single-product/product-image.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates - * @version 4.6.0 + * @version 4.7.0 */ defined( 'ABSPATH' ) || exit; diff --git a/templates/single-product/product-thumbnails.php b/templates/single-product/product-thumbnails.php index 2bebd8a4e5a..b666e03008c 100644 --- a/templates/single-product/product-thumbnails.php +++ b/templates/single-product/product-thumbnails.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates - * @version 4.6.0 + * @version 4.7.0 */ defined( 'ABSPATH' ) || exit;