Main image should be larger.

This commit is contained in:
Mike Jolley 2018-02-12 17:57:31 +00:00
parent a55a4b9a88
commit 2b36b5f49f
2 changed files with 4 additions and 3 deletions

View File

@ -1055,13 +1055,14 @@ if ( ! function_exists( 'woocommerce_show_product_thumbnails' ) ) {
*
* @since 3.3.2
* @param int $attachment_id
* @param bool $main_image Is this the main image or a thumbnail?
* @return string
*/
function wc_get_gallery_image_html( $attachment_id ) {
function wc_get_gallery_image_html( $attachment_id, $main_image = false ) {
$flexslider = (bool) apply_filters( 'woocommerce_single_product_flexslider_enabled', get_theme_support( 'wc-product-gallery-slider' ) );
$gallery_thumbnail = wc_get_image_size( 'gallery_thumbnail' );
$thumbnail_size = apply_filters( 'woocommerce_gallery_thumbnail_size', array( $gallery_thumbnail['width'], $gallery_thumbnail['height'] ) );
$image_size = apply_filters( 'woocommerce_gallery_image_size', $flexslider ? 'woocommerce_single': $thumbnail_size );
$image_size = apply_filters( 'woocommerce_gallery_image_size', $flexslider || $main_image ? 'woocommerce_single': $thumbnail_size );
$full_size = apply_filters( 'woocommerce_gallery_full_size', apply_filters( 'woocommerce_product_thumbnails_large_size', 'full' ) );
$thumbnail_src = wp_get_attachment_image_src( $attachment_id, $thumbnail_size );
$full_src = wp_get_attachment_image_src( $attachment_id, $full_size );

View File

@ -34,7 +34,7 @@ $wrapper_classes = apply_filters( 'woocommerce_single_product_image_gallery_cl
<?php
if ( has_post_thumbnail() ) {
// Note: `wc_get_gallery_image_html` was added in WC 3.3.2 and did not exist prior.
$html = wc_get_gallery_image_html( $post_thumbnail_id );
$html = wc_get_gallery_image_html( $post_thumbnail_id, true );
} else {
$html = '<div class="woocommerce-product-gallery__image--placeholder">';
$html .= sprintf( '<img src="%s" alt="%s" class="wp-post-image" />', esc_url( wc_placeholder_img_src() ), esc_html__( 'Awaiting product image', 'woocommerce' ) );