• Resolved intelijens

    (@intelijens)


    Hello there!

    Thanks for the excellent plugin!! I am asking if there is a way for the additional addresses to be displayed as radio buttons instead of as a select drop down? I would like the customer to be able to see all of their saved addresses to select before moving to the next step.

    Thanks to the author, contributors and the other subscribers!

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

    (@matt-h-1)

    Currently there is no built in way, but this is a good suggestion that we may consider adding.

    If you wanted to do it yourself currently, you could start with adding this filter to make it radio fields. Then you’d have to write the javascript yourself which would change the address when you selected a different radio box.

    
    /**
     * @param array $fields An array of WooCommerce Address fields.
     * @return array
     */
    function woo_address_book_radio_fields( $fields ) {
    	if ( isset( $fields['shipping']['address_book'] ) ) {
    		$fields['shipping']['address_book']['type'] = 'radio';
    	}
    	return $fields;
    }
    add_filter( 'woocommerce_checkout_fields', 'woo_address_book_radio_fields', 10000, 1 );
    
    Thread Starter intelijens

    (@intelijens)

    Thank you for the reply Matt!!
    I just noticed it now.

    I’ve kind of got it working on my own, but i’ll try this filter method and let you know how it goes!

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Addresses as radio button instead of dropdown, on check out?’ is closed to new replies.