簡體   English   中英

從Woocommerce管理員編輯訂單頁面刪除運輸行

[英]Remove shipping row from Woocommerce admin edit order pages

如何從管理員訂單頁面隱藏/刪除運送行? 請幫助,在此先感謝。

點擊查看截圖

也許看看這個? https://wordpress.org/plugins/hide-woocommerce-product-shipping-information/

它從產品中刪除了運輸信息,因此也可能從整個站點中刪除了該信息。

將此添加到您的功能文件中

<?php add_action( 'init', 'hide_shipping_details' );
    function hide_shipping_details() { 
        global $pagenow;
        if( is_admin() && $pagenow == "user-edit.php") { ?>
        <style> #fieldset-shipping{ display: none !important } </style>
    <?php } }

您可以根據需要更改CSS

要隱藏管理員訂單單頁中的運輸線和詳細信息,您將使用以下內容:

add_filter( 'woocommerce_order_get_items', 'custom_order_get_items', 10, 3 );
function custom_order_get_items( $items, $order, $types ) {
    if ( is_admin() && $types == array('shipping') ) {
        $items = array();
    }
    return $items;
}

代碼進入您的活動子主題(或活動主題)的function.php文件中。 經過測試和工作。

嘗試這個

add_action('admin_footer', 'my_custom_script');

function my_custom_script() {
  ?>
<script>
    jQuery(document).ready(function(){
      jQuery(".wc-order-totals .label:contains('Shipping')").parent().hide();
    });
</script>
<?php
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM