Я не могу найти способ изменить сообщение по умолчанию в Woocommerce, когда вы пытаетесь добавить другой продукт в корзину, помеченный как индивидуально проданный.
Я обнаружил, что при добавлении товаров в корзину вы редактируете сообщение об успехе по умолчанию:
add_filter ( 'wc_add_to_cart_message', 'wc_add_to_cart_message_filter', 10, 2 );
function wc_add_to_cart_message_filter($message, $product_id = null) {
$titles[] = get_the_title( $product_id );
$titles = array_filter( $titles );
$added_text = sprintf( _n( '%s has been added to your cart.', '%s have been added to your cart.', sizeof( $titles ), 'woocommerce' ), wc_format_list_of_items( $titles ) );
$message = sprintf( '%s <a href="%s" class="button">%s</a> <a href="%s" class="button">%s</a>',
esc_html( $added_text ),
esc_url( wc_get_page_permalink( 'checkout' ) ),
esc_html__( 'Checkout', 'woocommerce' ),
esc_url( wc_get_page_permalink( 'cart' ) ),
esc_html__( 'View Cart', 'woocommerce' ));
return $message;
}