iroberto83 Posted March 18, 2021 Share Posted March 18, 2021 (edited) Hi! I'm trying to fix a module; in a part of code I get carts, and for each one I've to calculate the total: $cart = new Cart($id_cart); ... $total = $cart->getOrderTotal(); When the code arrives at the total calculation, the "getOrderTotal()" trown to an exception in Product class: public static function getPriceStatic(... ... // If there is cart in context or if the specified id_cart is different from the context cart id if (!is_object($cur_cart) || (Validate::isUnsignedInt($id_cart) && $id_cart && $cur_cart->id != $id_cart)) { /* * When a user (e.g., guest, customer, Google...) is on PrestaShop, he has already its cart as the global (see /init.php) * When a non-user calls directly this method (e.g., payment module...) is on PrestaShop, he does not have already it BUT knows the cart ID * When called from the back office, cart ID can be inexistant */ if (!$id_cart && !isset($context->employee)) { die(Tools::displayError()); } ... What I need It's to obtain the total cart from a given id cart, please can you help me? Edited March 18, 2021 by iroberto83 (see edit history) 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