Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Rafy a11n

    (@nawaz0705)

    Hi @bastiaan1232

    Thank you for reaching out!

    I have just tested the Checkout page, but I do not see any prefilled text in the Checkout fields. Check the screenshot here: https://d.pr/i/rUcTh5

    The prefilled texts are probably coming from your browser. Check your browser settings and see if you have any address saved in Autofill section. Just curious, which browser you are using?

    Thread Starter bastiaan1232

    (@bastiaan1232)

    At “straatnaam” it has prefilled the other ones not

    Hello,

    You can clear your browser’s cache following the instructions on this page, then please check again your checkout page and let us know if the prefilled information is still present:
    https://wordpress.com/support/browser-issues/#clearing-your-browser-cache

    Thank you.

    Thread Starter bastiaan1232

    (@bastiaan1232)

    I want to customized the prefill how can i do that.

    Hi @bastiaan1232!

    Do you want to customize the placeholders of the checkout fields?

    If so, you can use the code below, as displayed in this article, to add custom placeholders to your checkout fields.

    add_filter( 'woocommerce_checkout_fields' , 'override_billing_checkout_fields', 20, 1 );
     function override_billing_checkout_fields( $fields ) {
    
         $fields['billing']['billing_first_name']['placeholder'] = 'Name';
         $fields['billing']['billing_last_name']['placeholder'] = 'Last Name';
         $fields['billing']['billing_company']['placeholder'] = 'Company name';
         $fields['billing']['billing_postcode']['placeholder'] = 'Postal code';
         $fields['billing']['billing_phone']['placeholder'] = 'Phone number';
         $fields['billing']['billing_city']['placeholder'] = 'City';
    
         $fields['shipping']['shipping_first_name']['placeholder'] = 'Name';
         $fields['shipping']['shipping_last_name']['placeholder'] = 'Last Name';
         $fields['shipping']['shipping_company']['placeholder'] = 'Company name';
         $fields['shipping']['shipping_postcode']['placeholder'] = 'Postal code';
         $fields['shipping']['shipping_phone']['placeholder'] = 'Phone number';
         $fields['shipping']['shipping_city']['placeholder'] = 'City';
    
         return $fields;
     }

    You can change the text between '' (example: ‘Name’) in the code above and replace it with the text you want.

    You can use a plugin like Code Snippets to add this snippet without having to edit your PHP code.

    You can check more about customizing checkout fields here:
    https://woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    I hope this helps!

    Thread Starter bastiaan1232

    (@bastiaan1232)

    You forgot email ?? can you change that in the code

    Thread Starter bastiaan1232

    (@bastiaan1232)

    Is there also a possibilty to change the ranking of things?

    So for example first
    First name
    Second name
    Zipcode
    Street

    Instead of
    First name
    Second name
    Street
    Zipcode

    Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there @bastiaan1232!

    You forgot email ?? can you change that in the code

    For email, you can add the line below to the code shared by my colleague:

    $fields['billing'][ 'billing_email' ]['placeholder'] = 'Email Address';

    For changing the order of the shipping and billing fields, you’ll need to add a code snippet defining the priorities of each field, as described here in this article: https://rudrastyh.com/woocommerce/reorder-checkout-fields.html

    For example:

    add_filter( 'woocommerce_checkout_fields', 'reorder_checkout_fields' );
    
    function reorder_checkout_fields( $checkout_fields ) {
    	$checkout_fields[ 'billing' ][ 'billing_email' ][ 'priority' ] = 4;
    	// Keep adding other fields here..
    	return $checkout_fields;
    }

    I hope this helps! ??

    Hi there,

    We haven’t heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, the information provided guided you in the right direction and you were able to solve your issue. If you have any further questions, we recommend creating a new thread.

    Cheers!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to change the prefilled information’ is closed to new replies.