Hello @yourinieuw,
Idk how but in the order summary, the product weight doesnt show right.
Can you guys help me?
That’s right, the order weight will not render in the order information from the admin or customer side.
I found the following snippet to add it programmatically, but it only works with orders made after you’ve added the snippet.
/**
* @snippet Save & Display Order Total Weight - WooCommerce Order
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 3.6.4
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
add_action( 'woocommerce_checkout_update_order_meta', 'bbloomer_save_weight_order' );
function bbloomer_save_weight_order( $order_id ) {
$weight = WC()->cart->get_cart_contents_weight();
update_post_meta( $order_id, '_cart_weight', $weight );
}
add_action( 'woocommerce_admin_order_data_after_billing_address', 'bbloomer_delivery_weight_display_admin_order_meta', 10, 1 );
function bbloomer_delivery_weight_display_admin_order_meta( $order ) {
echo '<p><strong>Order Weight:</strong> ' . get_post_meta( $order->get_id(), '_cart_weight', true ) . get_option( 'woocommerce_weight_unit' ) . '</p>';
}
Source.
You can add it to your functions.php file or use a plugin like Code snippet.
Hope this helps!