WC_Product::set_sale_price()
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() WC Product::set sale price code WC 9.7.1
public function set_sale_price( $price ) { $this->set_prop( 'sale_price', wc_format_decimal( $price ) ); }