Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 356-358 (lines=3) @@
353
			$image = get_the_post_thumbnail( $this->variation_id, $size, $attr );
354
		} elseif ( has_post_thumbnail( $this->id ) ) {
355
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
356
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
357
			$image = get_the_post_thumbnail( $parent_id, $size , $attr);
358
		} else {
359
			$image = wc_placeholder_img( $size );
360
		}
361
		return $image;

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

@@ 1549-1551 (lines=3) @@
1546
	public function get_image( $size = 'shop_thumbnail', $attr = array() ) {
1547
		if ( has_post_thumbnail( $this->id ) ) {
1548
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
1549
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1550
			$image = get_the_post_thumbnail( $parent_id, $size, $attr );
1551
		} else {
1552
			$image = wc_placeholder_img( $size );
1553
		}
1554