WC_Cart::get_cart_shipping_total()
Gets the shipping total (after calculation).
Method of the class: WC_Cart{}
Hooks from the method
Return
String
. price or string for the shipping total
Usage
$WC_Cart = new WC_Cart(); $WC_Cart->get_cart_shipping_total();
WC_Cart::get_cart_shipping_total() WC Cart::get cart shipping total code WC 9.8.1
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 ); }