To display units of measure with item quantities in the WooCommerce cart, modify the code. First, add a custom unit, like “kg” or “pcs.” Then, use the example below to show the unit next to the quantity.
add_filter('woocommerce_cart_item_quantity', 'show_cart_item_quantity', 10, 3);
function show_cart_item_quantity($quantity, $cart_item_key, $cart_item) {
return $quantity . ' pcs'; // Append 'pcs' to quantity
}