Support » Plugin: WooCommerce » Change Phone label

  • Resolved Casper

    (@reycasper21)


    Hi i would like to ask how can i change the “Phone” label in the checkout page

Viewing 4 replies - 1 through 4 (of 4 total)
  • Rafsun Chowdhury

    (@rafsuntaskin)

    Hi, @reycasper21

    Add this snippet in your theme’s functions.php

    
    add_filter( 'woocommerce_checkout_fields', 'rt_checkout_phone_label_override' );
    
    function rt_checkout_phone_label_override( $fields ){
        
        $fields['billing']['billing_phone']['label'] = 'Custom phone label';
       
        return $fields;
    }
    Casper

    (@reycasper21)

    Thanks @rafsuntaskin it’s working – Thank you. By the way my other problem is how to change the “Shipping Calculator” text in the cart page? I been using this code

    add_filter( ‘gettext’, ‘woocommerce_text_strings’, 20, 3 );
    function woocommerce_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case ‘shipping calculator’ :
    $translated_text = __( ‘Calculate Shipping’, ‘woocommerce’ );
    break;
    }
    return $translated_text;
    }

    But its now working

    Rafsun Chowdhury

    (@rafsuntaskin)

    You are welcome 🙂

    I think it’s called Calculate shipping now.

    You can try this text in your existing code instead of ‘shipping calculator’.

    Or you may edit the template by copying it to inside your theme’s woocommerce folder.

    This is the template :
    /plugins/woocommerce/templates/cart/shipping-calculator.php

    Thanks

    Plugin Support Shane Eckert

    (@shaneeckert)

    Automattic Happiness Engineer

    Hey Casper,

    I am going to resolve this thread since there has been no follow up in 5 months.

    If you still need some help, please open up a new thread.

    Cheers,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change Phone label’ is closed to new replies.