DiegoGBI Posted May 16, 2022 Share Posted May 16, 2022 Hi! This is my first cuestion! jeje, my english is not very good, sorry for that! I need to get the cart total in priceCalculation function. I need to check what is the amount of the cart to change products prices. Anybody can help me? Thanks for read! Link to comment Share on other sites More sharing options...
DiegoGBI Posted May 17, 2022 Author Share Posted May 17, 2022 (edited) Okey, it's easy by this way: $products = Context::getContext()->cart->getProducts(); foreach($products as $product){ $cart_total += $product['total']; } Edited May 17, 2022 by DiegoGBI (see edit history) Link to comment Share on other sites More sharing options...
Ress Posted May 18, 2022 Share Posted May 18, 2022 You can use this method to find out the total shopping cart: $with_taxes = true; $total = $cart_object->getOrderTotal($with_taxes, Cart::ONLY_PRODUCTS); 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