mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/78437435/how-do-i-change-the-text-below-recurring-total-in-woocommerce
10 lines
646 B
Text
10 lines
646 B
Text
function wcs_add_cart_first_renewal_payment_date( $order_total_html, $cart ) {
|
|
if ( 0 !== $cart->next_payment_date ) {
|
|
$first_renewal_date = date_i18n( wc_date_format(), wcs_date_to_time( get_date_from_gmt( $cart->next_payment_date ) ) );
|
|
// translators: placeholder is a date
|
|
$order_total_html .= '<div class="first-payment-date"><small>' . sprintf( __( 'First renewal: %s', 'woocommerce-subscriptions' ), $first_renewal_date ) . '</small></div>';
|
|
}
|
|
|
|
return $order_total_html;
|
|
}
|
|
add_filter( 'wcs_cart_totals_order_total_html', 'wcs_add_cart_first_renewal_payment_date', 10, 2 );
|