public function getWeight()
    {
        $weight = 0;

        foreach ($this->getCartItems() as $cartItem) {
            $itemWeight = $cartItem->getProductSaleElements()->getWeight();
            $itemWeight *= $cartItem->getQuantity();

            $weight += $itemWeight;
        }

        return $weight;
    }
public function getWeight()
    {
        $weight = 0;

        foreach ($this->getCartItems() as $cartItem) {
            $itemWeight = $cartItem->getProductSaleElements()->getWeight();
            $itemWeight *= $cartItem->getQuantity();

            $weight += $itemWeight;
        }

        return $weight;
    }
public function getWeight ( ) { $ weight = 0 ; foreach ( $ this -> getCartItems ( ) as $ cartItem ) { $ itemWeight = $ cartItem -> getProductSaleElements ( ) -> getWeight ( ) ; $ itemWeight *= $ cartItem -> getQuantity ( ) ; $ weight += $ itemWeight ; } return $ weight ; }
Retrieve the total weight for all products in cart

@return float|int
Retrieve the total weight for all products in cart