-
AuthorPosts
-
March 11, 2016 at 5:40 am #833456
In the woocommerce checkout page I would like to change the title of the check box ‘ship to a different address?’
I am using a custom font which doesn’t have a question mark so it’s displaying a square instead, so I would like to be able to remove the question mark from the title.I have tried adding the following to my child theme functions.php:
// WooCommerce Checkout Fields Hook
add_filter( ‘woocommerce_checkout_fields’ , ‘custom_wc_checkout_fields’ );// Change order comments placeholder and label
function custom_wc_checkout_fields( $fields ) {
$fields[‘order’][‘order_comments’][‘placeholder’] = ‘new placeholder text’;
$fields[‘order’][‘order_comments’][‘label’] = ‘new label’;
$fields[‘shipping’][‘ship-to-different-address-checkbox’][‘label’] = ‘Ship to a different address’;
return $fields;
}This has changed the order comments label and placeholder text but has not changed the ship to a different address.
website is: http://development.horseboxcoffeeco.com/checkout/
Any help on how to achieve this appreciated.
March 11, 2016 at 6:43 am #833527Hi there,
Thanks for writing in!
To change that, try adding following code in your child theme‘s functions.php file:
// ============================================================================= // Translate strings using 'gettext' filter hook. // ============================================================================= add_filter('gettext', 'custom_strings_translation', 20, 3); function custom_strings_translation( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Ship to a different address?' : $translated_text = __( 'Ship to a different address', '__x__' ); break; } return $translated_text; }
Thank you!
March 12, 2016 at 3:40 am #834654Worked perfectly. Many thanks
March 12, 2016 at 3:45 am #834658You’re welcome.
-
AuthorPosts