Code Duplication    Length = 3-3 lines in 2 locations

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

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

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

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