WC_Product::set_price()publicWC 1.0

Set the product's active price.

{} It's a method of the class: WC_Product{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Product = new WC_Product();
$WC_Product->set_price( $price );
$price(string) (required)
Price.

Code of WC_Product::set_price() WC 6.8.2

public function set_price( $price ) {
	$this->set_prop( 'price', wc_format_decimal( $price ) );
}