Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @raffi007 ,

    If I understand correctly, you want to hide the meta values added to the ordered items. This example code is working for me –

    //remove order item meta
    add_filter( 'woocommerce_order_item_get_formatted_meta_data', 'hide_order_item_get_formatted_meta_data', 10, 1 );
    
    function hide_order_item_get_formatted_meta_data($formatted_meta){
    
        if (isset($formatted_meta)) {
        	return '';
        }
    }

    You need to add this code in your current theme’s functions.php file.

    I hope this helps.

    Thank you ??

    Thread Starter raffi007

    (@raffi007)

    In fact i do not want to remove the product metas of the products in the order but rather the name if each product in the order is being added to the meta of the shipping method line as see on the image above.
    So let us say i purchased 1 x Table
    In the customer order i have a line saying 1 x table and the price and at the bottom
    Of the order i have free shipping as a shipping method and in the shipping meta i have 1x table being added which i dont want

    Hello @raffi007 ,

    Okay, I think I understand the area you are referring to.

    I could not locate a direct way to modify specifically this meta information. You can use this CSS to hide it on your wp-admin area –

    #order_shipping_line_items .shipping .name .view table.display_meta {
        display: none;
    }

    If you are interested to investigate further, here is the file from where this meta information is coming from – https://github.com/woocommerce/woocommerce/blob/trunk/includes/admin/meta-boxes/views/html-order-item-meta.php

    I hope this helps.

    Thank you ??

    Hi there,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thank you ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Product Meta being added to Shipping Line’ is closed to new replies.