check please: http://www.baroniarialb.cat/finalitza-la-compra/ I have AVADA and Woocommerce theme installed, but I need to change the "Have A Promotional Code?" and I can't find the correct code to do it. I have already tried different ways that appear on the internet without success from funtions.php. Could you guide me?
Asked
Active
Viewed 180 times
2 Answers
-1
Try this code. I've tested from the my side and it's working fine
function woocommerce_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) {
if ( is_admin() || 'woocommerce' !== $text_domain ) {
return $translated_text;
}
if ( 'Apply Coupon' === $text ) {
$translated_text = 'Put your text here'; //Here add your text which you want to replace
}
return $translated_text;
}
add_filter( 'changetext', 'woocommerce_rename_coupon_field_on_cart', 10, 3 );
You can change via jQuery also. Add the script in the footer.php file
<script>
jQuery("h2.promo-code-heading").text("Hello world!");
</script>

Full Stop
- 904
- 11
- 24
-
Thanks but dont work for me... This is my funtions.php – nib freelancer Jul 28 '21 at 11:40
-
I've update my ans with jquery so please check that @nibfreelancer – Full Stop Jul 28 '21 at 11:49
-
No, if I put jQuery code I get an error on the web. Am I doing something wrong? – nib freelancer Jul 28 '21 at 15:10
-
I've updated my answer please check that it's working fine on your website check this screenshot: http://prntscr.com/1hghugt – Full Stop Jul 29 '21 at 05:50
-
Thanks my friend, but when copy and paste this code mi site es broken: https://prnt.sc/1hhast4 – nib freelancer Jul 29 '21 at 06:45
-
Where do you add the script? @nibfreelancer – Full Stop Jul 29 '21 at 12:01
-
In this rute: ftp://baroniarialb2@ftp.baroniarialb.cat/httpdocs/wp/wp-content/themes/Avada/functions.php – nib freelancer Jul 29 '21 at 14:15
-
Script need to add in footer file not in function file @nibfreelancer – Full Stop Jul 30 '21 at 05:19
-1
For strings translations on plugins, we use the locotranslate plugin, simple, fast and can use translated files for more wordpress instances.

infoasistencia
- 9
- 3