- This topic has 4 replies, 2 voices, and was last updated 1 year, 6 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Creating an override custom error message
Hi,
I am wanting to change the current error message “coupon ‘…’ will be applied when its conditions are met” for all my coupons, I know I can do itin the front end however I have many coupons and are continually adding them, is there a way to change it?
You can use the ‘woocommerce_coupon_error’-filter for that. You can take a look at the source code of our plugin for inspiration.
What directory is the source code for this in your plugin?
/pro/plugins/WJECF_Pro_Coupon_Queueing.php
Looking further, I think the WC filter to override our meta-value ‘_wjecf_enqueue_message’ would be easier to implement. Something like this:
add_filter(
'woocommerce_coupon_get__wjecf_enqueue_message',
function( $value, $coupon ) {
return 'THE MESSAGE YOU WOULD LIKE TO SHOW';
}, 10, 2 );
(Snippet has not been tested)
This filter is defined in WooCommerce here: https://github.com/woocommerce/woocommerce/blob/e9e382adf8509ae407c68cc5ebef378f29de8cdc/plugins/woocommerce/includes/abstracts/abstract-wc-data.php#L352