get_meta('_advance_payment'); if ($advance_payment) { // Display the "Advance Paid" amount if ($plain_text) { // Translators: %s is the formatted advance payment amount. echo sprintf(esc_html__('Advance Paid: %s', 'advanced-conditional-cod-payment-system'), wp_kses_post(wc_price($advance_payment))). "\n"; } else { // Translators: %s is the formatted advance payment amount. echo '

' . sprintf(esc_html__('Advance Paid: %s', 'advanced-conditional-cod-payment-system'), wp_kses_post(wc_price($advance_payment))) . '

'; } } // Check if the order has an advance payment for remaining payment details $remaining_payment = $order->get_meta('_remaining_payment'); if ($advance_payment) { // Display the "Remaining Payment" amount if ($plain_text) { // Translators: %s is the formatted remaining payment amount. echo sprintf(esc_html__('Remaining Payment: %s', 'advanced-conditional-cod-payment-system'), wp_kses_post(wc_price($remaining_payment))) . "\n"; } else { // Translators: %s is the formatted remaining payment amount. echo '

' . sprintf(esc_html__('Remaining Payment: %s', 'advanced-conditional-cod-payment-system'), wp_kses_post(wc_price($remaining_payment))) . '

'; } } // Add remaining payment notice to the email if ($order->get_meta('_advance_payment')) { // Translators: %s is the formatted remaining payment amount. echo sprintf(esc_html__('Please note: You need to pay the remaining amount of %s upon delivery.', 'advanced-conditional-cod-payment-system'), wp_kses_post(wc_price($remaining_payment))); } }