Code Duplication    Length = 3-5 lines in 2 locations

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

@@ 333-337 (lines=5) @@
330
		$status = ( 'outofstock' === $status ) ? 'outofstock' : 'instock';
331
332
		// Sanity check
333
		if ( $this->managing_stock() ) {
334
			if ( ! $this->backorders_allowed() && $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount' ) ) {
335
				$status = 'outofstock';
336
			}
337
		}
338
339
		if ( update_post_meta( $this->id, '_stock_status', $status ) ) {
340
			$this->stock_status = $status;

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

@@ 490-492 (lines=3) @@
487
				$status = 'outofstock';
488
			}
489
		} elseif ( 'parent' === $this->managing_stock() ) {
490
			if ( ! $this->parent->backorders_allowed() && $this->parent->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount' ) ) {
491
				$status = 'outofstock';
492
			}
493
		}
494
495
		if ( update_post_meta( $this->variation_id, '_stock_status', $status ) ) {