Support » Plugin: Fluid Checkout for WooCommerce - Lite » Looking to edit the copy/remove field descriptions for address and phone number

  • Resolved allancaeg

    (@allancaeg)


    Under the address field, there’s text that says “House number and street name.”

    I’d like to edit this to “House or unit number, street name, etc”

    I’m also looking to make text changes for the content under the Shipping Phone field.

    Seems like this is custom text created by Fluid Checkout. How do I go about changing or removing the text?

    Thanks!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @allancaeg,

    You can use a Checkout Field Editor plugin for making those changes, or, use the code snippets below:

    Address fields

    /**
     * Change billing address 1 field args.
     */
    function fluidcheckout_change_billing_address_1_field_args( $fields ) {
    	// Bail if field is not present
    	if ( ! array_key_exists( 'billing_address_1', $fields ) ) { return $fields; }
    	
    	$fields[ 'billing_address_1' ][ 'label' ] = __( 'Address line 1', 'your-text-domain' );
    	// $fields[ 'billing_address_1' ][ 'label' ] = __( 'Address line 1 description here', 'your-text-domain' );
    	// $fields[ 'billing_address_1' ][ 'placeholder' ] = __( 'Apartment, suite, unit...', 'your-text-domain' );
    	
    	return $fields;
    }
    add_filter( 'woocommerce_billing_fields', 'fluidcheckout_change_billing_address_1_field_args', 300 );
    
    /**
     * Change shipping address 2 field args.
     */
    function fluidcheckout_change_shipping_address_1_field_args( $fields ) {
    	// Bail if field is not present
    	if ( ! array_key_exists( 'shipping_address_2', $fields ) ) { return $fields; }
    	
    	$fields[ 'shipping_address_1' ][ 'label' ] = __( 'Address line 1', 'your-text-domain' );
    	// $fields[ 'shipping_address_1' ][ 'label' ] = __( 'Address line 1 description here', 'your-text-domain' );
    	// $fields[ 'shipping_address_1' ][ 'placeholder' ] = __( 'Apartment, suite, unit...', 'your-text-domain' );
    	
    	return $fields;
    }
    add_filter( 'woocommerce_shipping_fields', 'fluidcheckout_change_shipping_address_1_field_args', 300 );

    Shipping phone

    /**
     * Change shipping phone field label.
     */
    function fluidcheckout_change_shipping_phone_label( $fields ) {
    	// Bail if shipping phone not available
    	if ( ! array_key_exists( 'shipping_phone', $fields ) ) { return $fields; }
    	
    	$fields[ 'shipping_phone' ]['label'] = __( 'Phone', 'your-text-domain' );
    	
    	// Uncomment the line below to change the field description
    	// $fields[ 'shipping_phone' ]['description'] = __( 'Your best phone number', 'your-text-domain' );
    	
    	// Uncomment the line below to remove the field description
    	// $fields[ 'shipping_phone' ]['description'] = null;
    	
    	return $fields;
    }
    add_filter( 'woocommerce_shipping_fields', 'fluidcheckout_change_shipping_phone_label', 300 );

    I’m closing this topic for now. If you need further assistance, please reply to this topic.

    Best,
    Diego

    Thread Starter allancaeg

    (@allancaeg)

    Thanks, the code snippets should do the trick!

    FYI, the Checkout Field Editor plugins are unable to override the settings. Probably because of properties marked as !important or something along those lines.

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @allancaeg,

    I’m glad the code snippets are working for you 🙂

    If you run into problems with the code snippet not applying the changes, try changing the priority to 1001+ because Checkout Field Editor might be applying changes after the code snippet.

    For more information about how to customize checkout fields, check our article:
    Customizing existing checkout field and adding custom checkout fields

    FYI, the Checkout Field Editor plugins are unable to override the settings. Probably because of properties marked as !important or something along those lines.

    Fluid Checkout uses as little !important as possible, and this only applies to CSS classes and other styles added to the field, and not to text or HTML markup.

    There is a limitation to using Checkout Field Editor, not related to Fluid Checkout though.

    Checkout Field Editor does not pick up new fields for that section when it already has saved the field attributes to its database.

    You would need to restore the initial field’s attributes by clicking the button “Restore fields”. However, you lose your other changes too.

    Best,
    Diego

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.