WC_Product::set_sale_price()publicWC 3.0.0

Set the product's sale price.

Method of the class: WC_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Product = new WC_Product();
$WC_Product->set_sale_price( $price );
$price(string) (required)
sale price.

Changelog

Since 3.0.0 Introduced.

WC_Product::set_sale_price() code WC 8.7.0

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