WC_Product::set_cogs_value()publicWC 1.0

Set the defined value of the Cost of Goods Sold for this product.

WARNING! If the Cost of Goods Sold feature is disabled this method will have no effect.

Method of the class: WC_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Product = new WC_Product();
$WC_Product->set_cogs_value( $value ): void;
$value(float) (required)
The value to set for this product.

WC_Product::set_cogs_value() code WC 9.5.1

public function set_cogs_value( float $value ): void {
	if ( $this->cogs_is_enabled( __METHOD__ ) ) {
		$this->set_prop( 'cogs_value', $value );
	}
}