Code Duplication    Length = 3-5 lines in 2 locations

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

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

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;