Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 350-352 (lines=3) @@
347
			$image_id = get_post_thumbnail_id( $this->variation_id );
348
		} elseif ( has_post_thumbnail( $this->id ) ) {
349
			$image_id = get_post_thumbnail_id( $this->id );
350
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
351
			$image_id = get_post_thumbnail_id( $parent_id );
352
		} else {
353
			$image_id = 0;
354
		}
355
		return $image_id;

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

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