Changing the terms and conditions text

Hi there,

I’m trying to change the terms and conditions text next to the checkbox in the basket. I’ve tried what was suggested in this topic: https://theme.co/apex/forums/topic/edit-terms-and-conditions-text-on-woocommerce-checkout-page/ but I can’t seem to get it to work.

My checkout page is here: https://www.photoonacake.co.uk/checkout/ at the moment all it says is I’ve read and accepted the terms & conditions but I would like to customise that to my own wording. Any tips would be greatly appreciated, please.

Cheers,

Ant

Hey There,

Thanks for writing in! What code did you use? You are supposed to use something like this:

add_filter('gettext', 'x_translated_text' );
function x_translated_text($translated) { 
    $your_translation = "Insert your translation here";
	$translated = str_ireplace('I&rsquo;ve read and accept the <a href="%s" target="_blank" class="woocommerce-terms-and-conditions-link">terms &amp; conditions</a>', $your_translation, $translated);
	return $translated; 
}

Hope this helps. Kindly let us know.

Hi @RueNel, that’s the code that I’ve tried but it doesn’t appear to change anything. I’ve cleared cache etc. but nothing changes. Sorry. Any further ideas?

Ant

Hey There,

​To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

To do this, you can create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

Thank you.

Sure, I’ll add it as a secure note…

Hey There,

Regretfully the given credentials is not working for us.
Please double check it as the password seems incorrect.

Thank you.

Oh I am sorry @RueNel, I have fixed that now and tested it, it should work for you ok now. Thank you.

Hey There,

I finally see the issue. The text keyword is not the same as the one in the code. I went ahead and updated the code and use this:

//Customise Terms & Conditions box 
add_filter('gettext', 'x_translated_text' );
function x_translated_text($translated) { 
    $your_translation = "Insert your translation here";
	$translated = str_ireplace('I&rsquo;ve read and accept the <a href="%s" target="_blank" class="woocommerce-terms-and-conditions-link">terms &amp; conditions</a>', $your_translation, $translated);
	return $translated; 
}

Please use our translation because right now it is displaying “Insert your translation here”.

Please let us know how it goes.

Thanks @RueNel, that has allowed me to change the text now, but I cannot add the link to the terms and conditions within the translated text, that causes a syntax error that crashes the whole site. Any thoughts would be welcomed. Thank you.

Ant

Hi Ant,

Please try something like this:

$your_translation = '<a href="#">Insert</a> your translation here';	

Hope this helps.

Thanks @Jade. Yes swapping out the " for ’ instead fixed the issue.

Have a lovely weekend.

Ant

Thank you, Ant. You too!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.