Code Duplication    Length = 3-3 lines in 2 locations

includes/abstracts/abstract-wc-product.php 1 location

@@ 1542-1544 (lines=3) @@
1539
	public function get_image( $size = 'shop_thumbnail', $attr = array(), $placeholder = true ) {
1540
		if ( has_post_thumbnail( $this->id ) ) {
1541
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
1542
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1543
			$image = get_the_post_thumbnail( $parent_id, $size, $attr );
1544
		} elseif ( $placeholder ) {
1545
			$image = wc_placeholder_img( $size );
1546
		} else {
1547
			$image = '';

includes/class-wc-product-variation.php 1 location

@@ 370-372 (lines=3) @@
367
			$image = get_the_post_thumbnail( $this->variation_id, $size, $attr );
368
		} elseif ( has_post_thumbnail( $this->id ) ) {
369
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
370
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
371
			$image = get_the_post_thumbnail( $parent_id, $size , $attr);
372
		} elseif ( $placeholder ) {
373
			$image = wc_placeholder_img( $size );
374
		} else {
375
			$image = '';