• Resolved benfrankie

    (@benfrankie)


    Hi,
    I noticed when I added some codes to function.php file to remove a few fields on the checkout page the credit card fields get disabled on custom checkout pages.

    A few developers gave up on this… Any suggestions?

    Thanks!

    custom checkout: https://socialempire.co/test1/?page_id=4771
    https://socialempire.co/test1/?page_id=4775
    test website: https://socialempire.co/test1/wp-admin
    admin2
    Sn&G9IzCTp8k0H&wxwzOIxL5

    code added:

    /* WooCommerce: The Code Below Removes Checkout Fields */
    add_filter( ‘woocommerce_checkout_fields’ , ‘custom_override_checkout_fields’ );

    function custom_override_checkout_fields( $fields ) {

    unset($fields[‘billing’][‘billing_last_name’]);

    unset($fields[‘billing’][‘billing_company’]);

    unset($fields[‘billing’][‘billing_address_1’]);

    unset($fields[‘billing’][‘billing_address_2’]);

    unset($fields[‘billing’][‘billing_city’]);

    unset($fields[‘billing’][‘billing_postcode’]);

    unset($fields[‘billing’][‘billing_country’]);

    unset($fields[‘billing’][‘billing_state’]);

    unset($fields[‘billing’][‘billing_phone’]);

    unset($fields[‘order’][‘order_comments’]);

    unset($fields[‘account’][‘account_username’]);

    unset($fields[‘account’][‘account_password’]);

    unset($fields[‘account’][‘account_password-2’]);

    return $fields;

    }

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Your payment gateway likely requires some of these fields in order to process the payment. Billing info is often used to validate the credit card and prevent fraud – you can’t just remove every field.

Viewing 1 replies (of 1 total)

The topic ‘Woocommerce Checkout Shourtcode not working’ is closed to new replies.