Hi there, could you direct me on the path to edit the “Coupon” text in the Checkout Page?
Right now, the default is: Have a coupon? Click here to enter your code
Would like to edit to: Have a promo code? Click here to enter your code
Thanks!
This topic has 12 replies, 5 voices, and was last updated 10 years, 1 months ago ago by Robert Hall
Hi there, could you direct me on the path to edit the “Coupon” text in the Checkout Page?
Right now, the default is: Have a coupon? Click here to enter your code
Would like to edit to: Have a promo code? Click here to enter your code
Thanks!
Hello,
You can change this text in \plugins\woocommerce\templates\checkout\form-coupon.php file on line 18.
Regards,
Robert Hall.
I currently have the Child Theme activated. How can I integrate this edit so future theme updates will not effect it? Thanks.
Hello,
In this case you need to translate this text. Please read more here how to translate:
http://docs.woothemes.com/document/woocommerce-localization/
Regards,
Robert Hall.
From the how to translate (localization) link you provided:
1) The Local Translate plugin doesn’t seem to work. I tried translating the words I want, the when I try to download the PO file, I keep getting a Page Not Found (404) Error.
2) The CodeStyling Localization link goes to a CodeStyling Localization Preserver plugin instead. I can’t use the Preserver Add-on Plugin without the CodeStyling Localization plugin and this one seems to no longer exist in the WP Plugins Directory.
3) The PoEdit plugin is too complicated to use.
Your thoughts? I only need to change couple words in the Checkout Page. They’re English to English edits, same language, just different wording. Thanks.
Hello
You may transfer this file to your child theme saving folders structure like Child Theme\woocommerce\templates\checkout\form-coupon.php.
With best regards
Brian Johnson
But these php files are in the “Plugins” folder, not inside “themes”. I don’t think the royal-child works since it only links to the “theme/royal”folder, right?
These are the two paths to the two files I want to change:
\plugins\woocommerce\templates\checkout\form-coupon.php
AND
\woocommerce\includes\abstracts\abstract-wc-payment-gateway.php
Hello,
You can copy the modified file /wp-content/plugins/woocommerce/templates/checkout/form-coupon.php to the directory wp-content/themes/royal-child/woocommerce/checkout.
Please try it.
Regards,
Eva Kemp.
Alright, so that worked for the form-coupon.php – Thanks!
But my other php file I need to edit has the path:
plugins\woocommerce\includes\abstracts\abstract-wc-payment-gateway.php
What’s the path to insert this into my royal-child folder to make it work?
Hello,
in this case we recommend you to contact Woocommerce support in order to receive qualified advice about editing plugin files. Please check here: https://support.woothemes.com/hc/en-us
Regards,
Stan Russell.
I added the script below to my royal-child/functions.php and it seems to work fine for simple locale translations. Thanks for the guidance!
add_filter(‘gettext’, ‘translate_text’);
add_filter(‘ngettext’, ‘translate_text’);
function translate_text($translated) {
$translated = str_ireplace(‘Expiry (MM/YY)’, ‘Expires (MM/YY)’, $translated);
return $translated;
}
Hello,
You’re welcome!
If you have any questions please feel free to contact us.
Regards,
Robert Hall.
The issue related to '‘WooCommerce Checkout – Changing Coupon Text’' has been successfully resolved, and the topic is now closed for further responses