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

@@ 500-502 (lines=3) @@
497
				$status = 'outofstock';
498
			}
499
		} elseif ( 'parent' === $this->managing_stock() ) {
500
			if ( ! $this->parent->backorders_allowed() && $this->parent->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount' ) ) {
501
				$status = 'outofstock';
502
			}
503
		}
504
505
		if ( update_post_meta( $this->variation_id, '_stock_status', $status ) ) {