Code Duplication    Length = 3-3 lines in 2 locations

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

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

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

@@ 1510-1512 (lines=3) @@
1507
1508
		if ( has_post_thumbnail( $this->id ) ) {
1509
			$image_id = get_post_thumbnail_id( $this->id );
1510
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1511
			$image_id = get_post_thumbnail_id( $parent_id );
1512
		} else {
1513
			$image_id = 0;
1514
		}
1515