WooCommerce结帐:隐藏结算明细

问题描述 投票:0回答:1

我不想拿账单信息,我想隐藏这个表格输入,并想组织结账页面,我试过

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_city']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_phone']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_email']);
unset($fields['billing']['billing_city']);
return $fields;
}

取消结算明细,但这不隐藏“结算明细”标签,无法整理结账页面,请帮忙,等待回复,提前致谢。

php woocommerce checkout
1个回答
0
投票
add_filter( 'woocommerce_billing_fields', 'custom_woocommerce_billing_fields', 100 );

function custom_woocommerce_billing_fields(){
    return [];
}

add_action( 'wp_head', 'include_styles' );

function include_styles() {
    if ( is_checkout() ) {
       echo '
            <style>
                .woocommerce-billing-fields h3 {
                    display: none;
                }
            </style>
       ';
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.