WC_Order_Item_Product::set_total
Line total (after discounts).
Method of the class: WC_Order_Item_Product{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Order_Item_Product = new WC_Order_Item_Product(); $WC_Order_Item_Product->set_total( $value );
- $value(string) (required)
- Total.
WC_Order_Item_Product::set_total() WC Order Item Product::set total code WC 10.4.3
public function set_total( $value ) {
$value = wc_format_decimal( $value );
if ( ! is_numeric( $value ) ) {
$value = 0;
}
$this->set_prop( 'total', $value );
// Subtotal cannot be less than total.
if ( '' === $this->get_subtotal() || $this->get_subtotal() < $this->get_total() ) {
$this->set_subtotal( $value );
}
}