Code Duplication    Length = 3-3 lines in 2 locations

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

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

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