Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 1522-1524 (lines=3) @@
1519
1520
		if ( has_post_thumbnail( $this->id ) ) {
1521
			$image_id = get_post_thumbnail_id( $this->id );
1522
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1523
			$image_id = get_post_thumbnail_id( $parent_id );
1524
		} else {
1525
			$image_id = 0;
1526
		}
1527

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;