Code Duplication    Length = 3-5 lines in 2 locations

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

@@ 743-747 (lines=5) @@
740
			$visible = false;
741
742
		// Published/private
743
		} elseif ( $this->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $this->id ) ) {
744
			$visible = false;
745
746
		// Out of stock visibility
747
		} elseif ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) && ! $this->is_in_stock() ) {
748
			$visible = false;
749
750
		// visibility setting
@@ 793-795 (lines=3) @@
790
			$purchasable = false;
791
792
		// Check the product is published
793
		} elseif ( $this->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $this->id ) ) {
794
			$purchasable = false;
795
		}
796
797
		return apply_filters( 'woocommerce_is_purchasable', $purchasable, $this );
798
	}