Code Duplication    Length = 3-5 lines in 2 locations

includes/abstracts/abstract-wc-product.php 2 locations

@@ 760-764 (lines=5) @@
757
			$visible = false;
758
759
		// Published/private
760
		} elseif ( $this->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $this->id ) ) {
761
			$visible = false;
762
763
		// Out of stock visibility
764
		} elseif ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) && ! $this->is_in_stock() ) {
765
			$visible = false;
766
767
		// visibility setting
@@ 810-812 (lines=3) @@
807
			$purchasable = false;
808
809
		// Check the product is published
810
		} elseif ( $this->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $this->id ) ) {
811
			$purchasable = false;
812
		}
813
814
		return apply_filters( 'woocommerce_is_purchasable', $purchasable, $this );
815
	}