I'm using Woocommerce and I'm trying to display the product weight for each product on cart page.
I have used this:
add_action('woocommerce_cart_collaterals', 'myprefix_cart_extra_info');
function myprefix_cart_extra_info() {
global $woocommerce;
echo '<div class="cart-extra-info">';
echo '<p class="total-weight">' . __('Total Weight:', 'woocommerce');
echo ' ' . $woocommerce->cart->cart_contents_weight . ' ' . get_option('woocommerce_weight_unit');
echo '</p>';
echo '</div>';
}
It display the total cart weight. I would like to also show the weight of each item in the cart as well.
How to display the product weight of each item on cart page?
Thanks.