Hi @aboriginalsun,
To change the placeholder of the coupon code, you can try the below snippet:
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Codice promozionale' :
$translated_text = __( 'Codice Promo', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
`
You can use a plugin like Code Snippets to add this to your site.
Let us know how it goes!
I added this using HFCM Plugin which I use for other snippets in header and footer.
Didnt work
Installed “Code Snippets”
This is the error I am facing –
https://snipboard.io/t7lQoA.jpg
Hello there,
I think you may need to delete the snippet in the HFCM plugin first. Then, you can add the snippet in the Code Snippets plugin.
Also, please check in the Code Snippets plugin to see if you have already declared a function called my_text_strings in another snippet. In this case, you only need to change the function name to something else.
Let me know if this works for you.
-
This reply was modified 3 years, 9 months ago by
Prin a11n. Reason: Added the second paragraph
I deleted from there. I resolved the issue. But it is not working. It only changes for split second while loading and goes back to normal
Hi @aboriginalsun,
In this case, may I suggest you use the Say what? plugin (https://wordpress.org/plugins/say-what/) instead.
After installing and activating the plugin:
1. Go to your siteβs dashboard.
2. On the left sidebar, click on Tools -> Text changes.
3. Click on the Add New button.
4. Type Coupon code for Original string.
5. Type woocommerce for Text domain.
6. Type the text you would like to display in the box under Replacement string
.
7. Click on the Add button.
Don’t forget to deactivate the snippet in the Code Snippets plugin.
Hope this helps.
Resolved. Thank you @prin_settasatian
Hi @aboriginalsun
Glad it is resolved! π
Thanks for using WooCommerce! If you have a few minutes, we’d love if you could leave a review for the WooCommerce plugin: https://wordpress.org/support/plugin/woocommerce/reviews/