public static function get_cart_shipping_total($for_display = true, $order_exclude_tax = false) { /* Quit early if there is no shipping label. */ if (!jigoshop_shipping::get_label()) { return false; } // Do not display taxes if shipping country is not set if (jigoshop_customer::get_shipping_country() == '') { return false; } /* Shipping price is 0.00. */ if (jigoshop_shipping::get_total() <= 0) { return $for_display ? __('Free!', 'jigoshop') : 0; } /* Not calculating taxes. */ if (self::get_options()->get('jigoshop_calc_taxes') == 'no') { return $for_display ? jigoshop_price(self::$shipping_total) : number_format(self::$shipping_total, 2, '.', ''); } if (self::get_options()->get('jigoshop_prices_include_tax') == 'no' || $order_exclude_tax) { $return = $for_display ? jigoshop_price(self::$shipping_total) : number_format(self::$shipping_total, 2, '.', ''); if (self::$shipping_tax_total > 0 && $for_display) { $return .= ' <small>' . __('(ex. tax)', 'jigoshop') . '</small>'; } } else { $return = $for_display ? jigoshop_price(self::$shipping_total + self::$shipping_tax_total) : number_format(self::$shipping_total + self::$shipping_tax_total, 2, '.', ''); if (self::$shipping_tax_total > 0 && $for_display) { $return .= ' <small>' . __('(inc. tax)', 'jigoshop') . '</small>'; } } return $return; }