WC_Cart::get_cart_shipping_total()
Gets the shipping total (after calculation).
Description Description
Return Return
(string) price or string for the shipping total
Source Source
File: includes/class-wc-cart.php
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 );
}