/** * Get the order total formatted to show when the order will be charged * * @since 1.0 * @param string $total price string ( note: this is already formatted by woocommerce_price() ) * @return string the formatted order total price string */ public function get_formatted_cart_total($total) { // this check prevents a formatted total from display anywhere but the cart/checkout page if ($this->cart_contains_pre_order()) { $total = WC_Pre_Orders_Manager::get_formatted_pre_order_total($total, self::get_pre_order_product()); } return $total; }
/** * Get the order total formatted to show when the order will be (or was) charged * * @since 1.0 * @param string $formatted_total price string ( note: this is already formatted by woocommerce_price() ) * @param object $order the WC_Order object * @return string the formatted order total price string */ public function get_formatted_order_total($formatted_total, $order) { // only modify the order total on the frontend when the order contains an active pre-order if (!is_admin() && $this->order_contains_pre_order($order) && 'active' !== $this->get_pre_order_status($order)) { $formatted_total = WC_Pre_Orders_Manager::get_formatted_pre_order_total($formatted_total, self::get_pre_order_product($order)); } return $formatted_total; }