MishoO Posted January 30, 2013 Share Posted January 30, 2013 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 More sharing options...
PotionsFactory Posted January 30, 2013 Share Posted January 30, 2013 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 More sharing options...
patfrat Posted August 21, 2013 Share Posted August 21, 2013 Hello, is this problem solved ? Don't you miss to add attributes to your getOrderTotal method like in the core class ? getOrderTotal($withTaxes=true,$type=Cart::BOTH) Link to comment Share on other sites More sharing options...
krishroman Posted January 11, 2017 Share Posted January 11, 2017 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