WC_Cart::get_cart_shipping_total PHP Method

get_cart_shipping_total() public method

Gets the shipping total (after calculation).
public get_cart_shipping_total ( ) : string
return string price or string for the shipping total
    public function get_cart_shipping_total()
    {
        if (isset($this->shipping_total)) {
            if ($this->shipping_total > 0) {
                // Display varies depending on settings
                if ('excl' === $this->tax_display_cart) {
                    $return = wc_price($this->shipping_total);
                    if ($this->shipping_tax_total > 0 && $this->prices_include_tax) {
                        $return .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
                    }
                    return $return;
                } else {
                    $return = wc_price($this->shipping_total + $this->shipping_tax_total);
                    if ($this->shipping_tax_total > 0 && !$this->prices_include_tax) {
                        $return .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
                    }
                    return $return;
                }
            } else {
                return __('Free!', 'woocommerce');
            }
        }
        return '';
    }
WC_Cart