deustotechMobility Posted June 14, 2016 Share Posted June 14, 2016 I'm trying to get the length, width and height total of all products in the cart. For the products I use the following line: $products = $params['cart']->getProducts(true); However if there is a unique product in the cart but 2 or more units that are wanted, with this line only detects me as if it were a single quantity and I can not add to the length, width and total height. $products = $params['cart']->getProducts(true); $alto = 0; $ancho = 0; $largo = 0; $peso = 0; foreach ($products as $product) { $peso = $peso + $product['weight']; $alto = $alto + $product['height']; $ancho = $ancho + $product['width']; $largo = $largo + $product['depth']; } Can someone tell me how to get all products in the cart, counting the units of each. Link to comment Share on other sites More sharing options...
deustotechMobility Posted June 14, 2016 Author Share Posted June 14, 2016 Okey ndiaga, that's the solution. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now