0

Here is my current code on a plugin.

    /**
     * Field Validation.
     */
    public function payment_process() {
        if ( 'woo_bkash' !== $_POST['payment_method'] ) {
            return;
        }

        $number   = sanitize_text_field( $_POST['bKash_acc_no'] );
        $trans_id = sanitize_text_field( $_POST['bKash_trans_id'] );

        if ( '' === $number ) {
            wc_add_notice( __( 'Please enter your bKash number.', 'bangladeshi-payment-gateways' ), 'error' );
        }

        if ( '' === $trans_id ) {
            wc_add_notice( __( 'Please enter your bKash transaction ID.', 'bangladeshi-payment-gateways' ), 'error' );
        }
    }

I want to make these fileds optional by adding code on the function.php file of the child theme.

3
  • 1
    Discussions on third-party plugins are off-topic here. You will get better help in WooCommerce support channels.
    – Abhik
    May 9 at 3:51
  • Okay, thank you! May 9 at 5:16
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    2 days ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.