Code Duplication    Length = 3-3 lines in 2 locations

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

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

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

@@ 357-359 (lines=3) @@
354
			$image = get_the_post_thumbnail( $this->variation_id, $size, $attr );
355
		} elseif ( has_post_thumbnail( $this->id ) ) {
356
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
357
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
358
			$image = get_the_post_thumbnail( $parent_id, $size , $attr);
359
		} elseif ( $placeholder ) {
360
			$image = wc_placeholder_img( $size );
361
		} else {
362
			$image = '';