【发布时间】:2020-05-02 15:17:10
【问题描述】:
我想删除(不仅仅是隐藏)购物车和结帐页面上的第一个付款日期,因为这让我的客户非常困惑。 我没有找到覆盖 html 输出的位置和方法。
信息是从 woocommerce 订阅函数 (wcs-cart-functions.php) 添加的,如下所示:
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 );
出于显而易见的原因,我不想修改核心文件。
我尝试的是在我的主题 CSS 中添加一个 display:none。它有效,但它只是隐藏了信息。
.woocommerce-checkout-review-order-table .first-payment-date {
display: none;
}
感谢您提供的线索和想法。 弗雷德
【问题讨论】:
标签: php woocommerce checkout subscription