WC_Cart::get_cart_shipping_total()publicWC 1.0

Gets the shipping total (after calculation).

Метод класса: WC_Cart{}

Хуки из метода

Возвращает

Строку. price or string for the shipping total

Использование

$WC_Cart = new WC_Cart();
$WC_Cart->get_cart_shipping_total();

Код WC_Cart::get_cart_shipping_total() WC 8.7.0

public function get_cart_shipping_total() {

	// Default total assumes Free shipping.
	$total = __( 'Free!', 'woocommerce' );

	if ( 0 < $this->get_shipping_total() ) {

		if ( $this->display_prices_including_tax() ) {
			$total = wc_price( $this->shipping_total + $this->shipping_tax_total );

			if ( $this->shipping_tax_total > 0 && ! wc_prices_include_tax() ) {
				$total .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
			}
		} else {
			$total = wc_price( $this->shipping_total );

			if ( $this->shipping_tax_total > 0 && wc_prices_include_tax() ) {
				$total .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
			}
		}
	}
	return apply_filters( 'woocommerce_cart_shipping_total', $total, $this );
}