Jump to content

ContextErrorException Warning: Declaration of Cart::getOrderTotal


Designinfo.in

Recommended Posts

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) ContextErrorException
Warning: 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.

Screenshot 2021-02-10 at 8.52.37 PM.png

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 1 month later...
  • 3 months later...
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

  • 1 year later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...