简体   繁体   中英

Hide general and shipping details when adding a new order in Woocommerce admin

In the admin page when you press "add new order" there is General Details, Billing Details and Shipping Details:

图片在这里

I would love to hide some these with CSS. I've tried all day but have been able to achieve this unsuccessfully.

I just want to keep the Billing details visible. Is that possible?

This can be done simply with the following hooked function and some specific CSS rules:

add_action('admin_head', 'my_admin_head');
function my_admin_head() {
    ?>
    <style>
    .post-new-php.post-type-shop_order #postbox-container-2 .order_data_column_container > .order_data_column:first-child,
    .post-new-php.post-type-shop_order #postbox-container-2 .order_data_column_container > .order_data_column:last-child {
        display:none !important;
    }
    </style>
<?php
}

Code goes in function.php file of your active child theme (or active theme).

Tested and works…

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM