Support » Theme: Hestia » Products without image should display WooCommerce’s placeholder image.

  • Resolved Casper Braske

    (@casper-braske)


    I think that in order to be more compliant to WooCommerce, the template for the products in the “shop” section in the front page could use like in woocommerce/single-product/product-image.php:

    if ( has_post_thumbnail() ) {
    			$html  = '<div data-thumb="' . get_the_post_thumbnail_url( $post->ID, 'shop_thumbnail' ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">';
    			$html .= get_the_post_thumbnail( $post->ID, 'shop_single', $attributes );
    			$html .= '</a></div>';
    		} 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' ) );
    			$html .= '</div>';
    		}
Viewing 2 replies - 1 through 2 (of 2 total)
  • Can’t edit anymore ¬¬

    It was supposed to read “could use wc_placeholder_img_src“.

    Hello @casper-braske,

    Thank you for this suggestion I really appreciate it but the theme is designed in the way to show only the uploaded product image on the front page, not the default placeholder image.

    Let us know if you have any query regarding the theme.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Products without image should display WooCommerce’s placeholder image.’ is closed to new replies.