Jump to content

Problem overriding cart.php


MishoO

Recommended Posts

I am getting an error when i try to override the class Cart

 

My Cart.php :

 

class Cart extends CartCore
{
public function getOrderTotal()
{   
 $total =  parent::getOrderTotal();
		    //other instruction...
}
}

 

The error in front-office is :

 

Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 43 bytes) in /var/www/vhosts/emergence-it.net/sites/bijoux/cache/class_index.php on line 548

 

 

The problem is solved when I comment parent::getOrderTotal() line or when i comment the override function.

 

what is the reason of this behavior ?

 

thank you for your help

Link to comment
Share on other sites

Would you be able to get your hosting provider to raise your memory limit? Or, if you have access to your PHP.ini file, you could add this line

 

memory_limit = 128M

 

Your code looks fine. It looks like your system is simply running close to it's memory limit. Your override may be pushing the system over that limit. It doesn't mean that anything is wrong with your code, just that PrestaShop needs a little more memory to run.

Link to comment
Share on other sites

  • 6 months later...
  • 3 years later...

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...