Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Creating an override custom error message › Reply To: Creating an override custom error message

#18893
Soft79
Keymaster

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