Tagged: woocommerce
I wanted to change Shipping to Delivery throughout. I’m using the code below and it seems to be working on other theme but not on Enfold. Using Enfold theme, the backend is changed but not the Cart and Checkout page.
function fix_woocommerce_strings( $translated, $text, $domain ) {
// STRING 1
$translated = str_ireplace( 'Shipping', 'Delivery', $translated );
return $translated;
}
add_filter( 'gettext', 'fix_woocommerce_strings', 999, 3 );
Do I need to change this manually on Enfold template. If so, where can I place the page in the child theme?
Hey dinmix,
Sorry for the late reply, I have tested this function on my localhost and it worked correctly in the Cart and Checkout page. Try adding this code to the end of your functions.php file in Appearance > Editor:
add_filter( 'woocommerce_shipping_package_name' , 'woocommerce_replace_text_shipping_to_delivery', 10, 3);
function woocommerce_replace_text_shipping_to_delivery($package_name, $i, $package){
return sprintf( _nx( 'Delivery', 'Delivery %d', ( $i + 1 ), 'shipping packages', 'put-here-you-domain-i18n' ), ( $i + 1 ) );
}
Then clear your browser cache and check.
Best regards,
Mike
Thank you Mike! it works.