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

@@ 1546-1548 (lines=3) @@
1543
1544
		if ( has_post_thumbnail( $this->id ) ) {
1545
			$image_id = get_post_thumbnail_id( $this->id );
1546
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1547
			$image_id = get_post_thumbnail_id( $parent_id );
1548
		} else {
1549
			$image_id = 0;
1550
		}
1551