- This topic has 2 replies, 2 voices, and was last updated 3 years, 6 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Overriding Error Message
I cannot use custom error message since using “is_first_purchase” I have 2 different types on messages
Instead of:
msgid "Sorry, it seems the coupon \"%s\" is not yours.
i want to display:
msgid "Sorry, it seems the coupon \"%s\" is not yours. Please Ensure You Are Logged Into Your Account"
if i override the error message in miscellaneous it will display for both logged in and non logged in and will also display that error message for first purchase.
Ideally changing the pot file should work but it doesn’t how can i change the txt string in pot file for it to work I only use English and do not want to use translate plugin
You can override the text by using gettext filter. It looks like this plugin does the trick:
https://nl.wordpress.org/plugins/gettext-override-translations/
I haven’t tested it.
i have already tried gettext filter and does not work at all
also the plugin does not work either
i managed to fix by editing error.php in woocommerce templates adding below
if (strpos($message, '" is not yours.') !== false) {
$message = $message.'<br><br><b> PLEASE LOGIN INTO YOUR ACCOUNT TO USE THIS COUPON</b>'; //updated error string
}?>
Thanks Anyway for your help