Я не уверен, что сделал это правильно после прочтения хука woocommerce_add_$NOTICE_TYPE. Я хочу изменить сообщение об успешном применении кода купона на свой собственный текст, например:
The %coupon_name% promotion code has been applied and redeemed successfully.
Но я не знаю, как узнать название купона.
add_filter( 'woocommerce_add_notice', function( $message ){
// get the coupon name here
if( $message == 'Coupon code applied successfully.' )
$message = 'The %coupon_name% promotion code has been applied and redeemed successfully.';
return $message;
});
Подробнее здесь: https://stackoverflow.com/questions/622 ... oocommerce