Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 1495-1497 (lines=3) @@
1492
1493
		if ( has_post_thumbnail( $this->id ) ) {
1494
			$image_id = get_post_thumbnail_id( $this->id );
1495
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1496
			$image_id = get_post_thumbnail_id( $parent_id );
1497
		} else {
1498
			$image_id = 0;
1499
		}
1500

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;