WC_Product::set_price
Set the product's active price.
Method of the class: WC_Product{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Product = new WC_Product(); $WC_Product->set_price( $price );
- $price(string) (required)
- Price.
WC_Product::set_price() WC Product::set price code WC 10.7.0
public function set_price( $price ) {
$this->set_prop( 'price', wc_format_decimal( $price ) );
}