WC_Cart::get_total() public WC 3.2.0
Gets cart total after calculation.
{} Это метод класса: WC_Cart{}
Хуки из метода
Возвращает
float.
Использование
$WC_Cart = new WC_Cart(); $WC_Cart->get_total( $context );
- $context(строка)
- If the context is view, the value will be formatted for display. This keeps it compatible with pre-3.2 versions.
Список изменений
С версии 3.2.0 | Введена. |
Код WC_Cart::get_total() WC Cart::get total WC 5.0.0
public function get_total( $context = 'view' ) {
$total = apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'total' ) );
return 'view' === $context ? apply_filters( 'woocommerce_cart_total', wc_price( $total ) ) : $total;
}