Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 337-339 (lines=3) @@
334
			$image_id = get_post_thumbnail_id( $this->variation_id );
335
		} elseif ( has_post_thumbnail( $this->id ) ) {
336
			$image_id = get_post_thumbnail_id( $this->id );
337
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
338
			$image_id = get_post_thumbnail_id( $parent_id );
339
		} else {
340
			$image_id = 0;
341
		}
342
		return $image_id;

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

@@ 1523-1525 (lines=3) @@
1520
1521
		if ( has_post_thumbnail( $this->id ) ) {
1522
			$image_id = get_post_thumbnail_id( $this->id );
1523
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1524
			$image_id = get_post_thumbnail_id( $parent_id );
1525
		} else {
1526
			$image_id = 0;
1527
		}
1528