update_meta_data('payment_information', $payment_information); $order->save(); } } /** * Display advance payment information on the checkout page */ public static function display_advance_payment_info() { $isChecked = Advance_Payment_Settings::pluign_check_enabled(); if ($isChecked) { //Display payment information box woocommerce_form_field('payment_information', array( 'type' => 'textarea', 'class' => array('form-row-wide'), 'label' => esc_html_e('Payment Information', 'advance-payment-wc'), 'required' => true, )); echo ''; } } /** * Display advance payment details in admin order page * * */ public static function display_advance_payment_details() { $isChecked = Advance_Payment_Settings::pluign_check_enabled(); if ($isChecked) { global $post; // Check if we are on an order edit page if (is_admin() && get_post_type($post) === 'shop_order') { $order = wc_get_order($post); $payment_information = $order->get_meta('payment_information'); echo '
'. esc_html_e('Payment Information:', 'advance-payment-wc') . ' ' . esc_html($payment_information) . '
'; echo '' . esc_html_e('Advance Payment Amount:', 'advance-payment-wc') . ' ' . esc_html(wc_price($advance_payment)) . '
'; echo '' . esc_html_e('Payment Information:', 'advance-payment-wc') . ' ' . esc_html($payment_information) . '
'; } } } Advance_Payment::init(); }