Replace WooCommerce Texts Without a Translation Plugin
Swaps specific WooCommerce texts, such as "Billing details" or "Proceed to checkout", for your own wording using a simple list.
Opens WPIDE on
Code
$wpide_store_text = array(
// Original text => replacement.
'Billing details' => 'Your details',
'Proceed to checkout' => 'Continue to checkout',
'Related products' => 'You may also like',
);
add_filter( 'gettext_woocommerce', function ( $translation, $text ) use ( $wpide_store_text ) {
return isset( $wpide_store_text[ $text ] ) ? $wpide_store_text[ $text ] : $translation;
}, 20, 2 );
Notes
The original text must match exactly, including capitals. Texts in blocks may come from JavaScript translations and are not affected.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.