WC_Product::set_regular_price()publicWC 3.0.0

Set the product's regular price.

Method of the class: WC_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Product = new WC_Product();
$WC_Product->set_regular_price( $price );
$price(string) (required)
Regular price.

Changelog

Since 3.0.0 Introduced.

WC_Product::set_regular_price() code WC 8.7.0

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