public function get_cart_contents_weight() { $weight = 0; foreach ($this->get_cart() as $cart_item_key => $values) { $weight += $values['data']->get_weight() * $values['quantity']; } return apply_filters('woocommerce_cart_contents_weight', $weight); }