Designinfo.in Posted February 10, 2021 Share Posted February 10, 2021 Prestashop 1.7.7 When i switch on debug mode and load any product page, I receive the error as per the attached image: (1/1) ContextErrorExceptionWarning: Declaration of Cart::getOrderTotal($withTaxes = true, $type = self::BOTH, $products = NULL, $id_carrier = NULL, $use_cache = true) should be compatible with CartCore::getOrderTotal($withTaxes = true, $type = Cart::BOTH, $products = NULL, $id_carrier = NULL, $use_cache = false, bool $keepOrderPrices = false) All the pages load normally, however it is a bit slower than Prestashop v1.7.5 from which I recently upgraded with no upgradation errors. Also the MySQL usage shoots upto 200%. I have no overrides. Using a Zone Theme. No cache modules being used. Link to comment Share on other sites More sharing options...
JBW Posted February 10, 2021 Share Posted February 10, 2021 14 minutes ago, Designinfo.in said: I have no overrides. Look at your error message again - you have an override in /override/classes/Cart.php that is not compatible to your Prestashop version Link to comment Share on other sites More sharing options...
kolmen Posted February 25, 2021 Share Posted February 25, 2021 i have the same problem how fix it? What exactly should be corrected? Link to comment Share on other sites More sharing options...
ronaldolivo Posted March 15, 2021 Share Posted March 15, 2021 I have the same problem. I would really appreciate it if you tell me you tweaked to fix it. Link to comment Share on other sites More sharing options...
fjratelier Posted March 15, 2021 Share Posted March 15, 2021 Hello, we have also the same problem. Have you found a solution? Thanks. Link to comment Share on other sites More sharing options...
kolmen Posted March 15, 2021 Share Posted March 15, 2021 should be like in warning so need to add "bool $keepOrderPrices = false" in override file Link to comment Share on other sites More sharing options...
ronaldolivo Posted May 9, 2021 Share Posted May 9, 2021 Hi, for people looking for a solution to this problem, the latest versions of prestashop are not using the file cart.php and you can rename the file to cart_OLD.php and the error will disappear. I hope this saves someone time. Link to comment Share on other sites More sharing options...
gray Posted August 19, 2021 Share Posted August 19, 2021 I have the same problem, and I am using ps 1.7.7.5 and 1.7.7.6 I have renamed /override/classes/Cart.php But I now get another error. Any ideas please. Link to comment Share on other sites More sharing options...
JBW Posted August 20, 2021 Share Posted August 20, 2021 11 hours ago, gray said: But I now get another error. Any ideas please. You have more overrides, see details in the error message (classes/Product.php). Better deinstall the module that installed this overrides to avoid further issues. Link to comment Share on other sites More sharing options...
Anawim Posted October 10, 2022 Share Posted October 10, 2022 In "/override/classes/CartRule.php" around line 40, you can add the parameter "$useOrderPrices" to be compatible with the parent method in class CartRuleCore. Replace this line public function checkValidity(Context $context, $alreadyInCart = false, $display_error = true, $check_carrier = true) with public function checkValidity(Context $context, $alreadyInCart = false, $display_error = true, $check_carrier = true, $useOrderPrices = false) Hope it does help, but i think the error will happen again after each PrestaShop update. 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