Следующий код отобразит пользовательское сообщение со связанной кнопкой текста в верхней части страницы корзины:
add_action('woocommerce_before_cart', 'add_cart_custom_notice');
function add_cart_custom_notice() {
// HERE the link to your content
$link = '#';
// For example, print a notice with a linked button (the text is editable and translatable)
wc_print_notice( sprintf( '<span class="subscription-reminder">' .
__('Pellentesque habitant morbi tristique senectus et netus et malesuada fames %s', 'woocommerce') . '</span>',
'<a href='.$link.' class="button alt" style="float:right">'. __('Go to the subscription form', 'woocommerce') .'</a>'
), 'notice' );
}
Код помещается в файл function.php вашей активной дочерней темы (или активной темы). Проверено и работает.