I use woocommerce for wholesale customers who order containers of furniture - normally 40 foot containers with a volume of 68 cubic meters.
Is there a way I can show
You can try something like this:
cart->get_cart();
$cart_prods_m3 = array();
//LOOP ALL THE PRODUCTS IN THE CART
foreach($items as $item => $values) {
$_product = wc_get_product( $values['data']->get_id());
//GET GET PRODUCT M3
$prod_m3 = $_product->get_length() *
$_product->get_width() *
$_product->get_height();
//MULTIPLY BY THE CART ITEM QUANTITY
//DIVIDE BY 1000000 (ONE MILLION) IF ENTERING THE SIZE IN CENTIMETERS
$prod_m3 = ($prod_m3 * $values['quantity']) / 1000000;
//PUSH RESULT TO ARRAY
array_push($cart_prods_m3, $prod_m3);
}
echo "Total of M3 in the cart: " . array_sum($cart_prods_m3);
?>
See WC() docs: https://docs.woocommerce.com/document/class-reference/