skip to Main Content

I am facing a problem while checking out from the store. There are two boxes for entering the address:

1) in the address area, where it appears inside the “street name and number” box,

2) another box for number.

At the time it ends, the orders (I have already finalized some to test the payment methods) I realized that the first address box is optional, because when you type the number in the number box, it is automatically recognized in the order area.

I’ve been doing some research and saw how to add some lines of code in WordPress “functions.php” file to change this text, but I couldn’t find how to do it properly.

I have already tried to use this plugin called Checkout Field Editor but it conflicting with WooCommerce Extra Checkout Fields for Brazil. And the checkbox that toggles between “cpf” and “cnpj” is all compressed on the left without being able to see its contents.

2

Answers


  1. Chosen as BEST ANSWER

    Of course, I delete the conflicting plugin (Checkout Field Editor in this case), my main problem is how can I write this code

    // Hook in
       add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    
    // Our hooked in function - $fields is passed via the filter!
       function custom_override_checkout_fields($fields){
         $fields['billing']['billing_address_1']['placeholder'] = 'Nome da rua';
        return $fields;
       }
    

    to change the address field placeholder to just 'street name', and not "street name and number", because as I explained, the "number" field already does its job.


  2. As per you explanation, I understood that you are trying to use 2 plugins at once. Both of the plugins are used for editing the Checkout fields. So, it is possible that they are going to conflict when they are used together.

    Consider disabling one of these 2 Checkout field editor plugins according to your needs and that should solve your problem.

    Tip: Use the plugin with the most features and disable the one with the least features.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search