WC_Order_Item_Product::set_total( string $value )
Line total (after discounts).
Description Description
Parameters Parameters
- $value
-
(Required) Total.
Source Source
File: includes/class-wc-order-item-product.php
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 );
}
}