• Resolved aardalino

    (@aardalino)


    Hi!

    I’ve been using your plugin for a while now and it’s been working great. I have encountered a scenario where I would like to remove the users option of selecting ‘Add new address’ in the drop down at checkout, both for shipping and billing. Is this possible?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Harrison

    (@matt-h-1)

    You can use this code snippet for removing the add new address options from checkout.

    function remove_add_new_address( $fields ) {
    	if ( isset( $fields['billing']['billing_address_book']['options']['add_new'] ) ) {
    		unset( $fields['billing']['billing_address_book']['options']['add_new'] );
    	}
    	if ( isset( $fields['shipping']['shipping_address_book']['options']['add_new'] ) ) {
    		unset( $fields['shipping']['shipping_address_book']['options']['add_new'] );
    	}
    
    	return $fields;
    }
    add_filter( 'woocommerce_checkout_fields', 'remove_add_new_address', 20000, 1 );
    Thread Starter aardalino

    (@aardalino)

    Worked perfectly! Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove ‘Add new address’’ is closed to new replies.