Site logo

Archived topic

How can i change the text in mini cart

7 replies · Started by Danielle on June 12, 2022

Viewing posts 1–8 of 8

You see the button ''afrekenen. How can i change this to another text?

Hi Danielle,

You can try this PHP snippet:

add_filter( 'gettext', function( $translated_text ) {
	
	if ( 'Checkout' === $translated_text ) {
        $translated_text = 'Your new text here';
    }

    return $translated_text;
} );

Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets

Hope this helps!

It didnt change :/

Hi there,

try this:

add_filter( 'gettext', function( $translated_text ) {
	
	if ( 'Checkout' === $translated_text ) {
        $translated_text = 'Your new text here';
    }

    return $translated_text;
}, 999 );

Still didnt change

Can you clear any plugin or server caches.
And clear the Woocommerce transients in Dashboard > Woocommerce > Status > Tools.
Adding an item to the cart and emptying the cart can also clear transients

I am sorry i did but still didnt work

I just tested the code on my end and it works well.

If clearing cache and Woocommerce transients don't work, disable all your plugins except GP premium, Woocommerce and code snippet to test, try disable all other snippet in code snippet plugin to avoid conflicts.

This archived topic is closed to new replies.