Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 345-347 (lines=3) @@
342
			$image_id = get_post_thumbnail_id( $this->variation_id );
343
		} elseif ( has_post_thumbnail( $this->id ) ) {
344
			$image_id = get_post_thumbnail_id( $this->id );
345
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
346
			$image_id = get_post_thumbnail_id( $parent_id );
347
		} else {
348
			$image_id = 0;
349
		}
350
		return $image_id;

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

@@ 1535-1537 (lines=3) @@
1532
1533
		if ( has_post_thumbnail( $this->id ) ) {
1534
			$image_id = get_post_thumbnail_id( $this->id );
1535
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1536
			$image_id = get_post_thumbnail_id( $parent_id );
1537
		} else {
1538
			$image_id = 0;
1539
		}
1540