Code Duplication    Length = 3-5 lines in 2 locations

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

@@ 747-751 (lines=5) @@
744
			$visible = false;
745
746
		// Published/private
747
		} elseif ( $this->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $this->id ) ) {
748
			$visible = false;
749
750
		// Out of stock visibility
751
		} elseif ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) && ! $this->is_in_stock() ) {
752
			$visible = false;
753
754
		// visibility setting
@@ 797-799 (lines=3) @@
794
			$purchasable = false;
795
796
		// Check the product is published
797
		} elseif ( $this->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $this->id ) ) {
798
			$purchasable = false;
799
		}
800
801
		return apply_filters( 'woocommerce_is_purchasable', $purchasable, $this );
802
	}