This is my code below and I've tried \n
'\n' '
' but nothing worked. I want to have two lines or paragraphs with First Line and Second Line in the discount line on the cart page
function prefix_add_discount_line( $cart ) {
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
$chosen_shipping_no_ajax = $chosen_methods[0];
if ( 0 === strpos( $chosen_shipping_no_ajax, 'local_pickup' ) ) {
// Define the discount percentage
$discount = $cart->subtotal * 0.15;
// Add your discount note to cart
$cart->add_fee( __( 'First Line (Second line)', 'yourtext-domain') , -$discount );
}
}
add_action( 'woocommerce_cart_calculate_fees', 'prefix_add_discount_line');