WC_Product::set_stock_quantity( float|null $quantity )

Set number of items available for sale.


Description Description


Parameters Parameters

$quantity

(Required) Stock quantity.


Top ↑

Source Source

File: includes/abstracts/abstract-wc-product.php

	public function set_stock_quantity( $quantity ) {
		$this->set_prop( 'stock_quantity', '' !== $quantity ? wc_stock_amount( $quantity ) : null );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.