cdthomas23 Posted January 10, 2014 Share Posted January 10, 2014 I am trying to modify CartRule.php. In order to get the amount I need, I really need to be able to get just the shipping amount. So, I add the following line to just store it in a variable: $cdtShip = $context->cart->getOrderTotal(true, Cart::ONLY_SHIPPING); As soon as I do this, I get a blank page. No problems at all if I do this, however: $cdtShip = $context->cart->getOrderTotal(true, Cart::ONLY_PRODUCTS); Any idea why the Cart::ONLY_SHIPPING is causing problems? Thank you very much in advance. Link to comment Share on other sites More sharing options...
cdthomas23 Posted January 10, 2014 Author Share Posted January 10, 2014 A little more info. I figured out how to turn debug on and I get the following when making that call: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in /home/XXX/shop/classes/Cart.php on line 1913 Why is this call doing that? Link to comment Share on other sites More sharing options...
vekia Posted January 10, 2014 Share Posted January 10, 2014 you see this message because you exceeded the memory limit on your hosting account. try to increase it (or ask your hoster) and then try again, will see what's going on then Link to comment Share on other sites More sharing options...
cdthomas23 Posted January 10, 2014 Author Share Posted January 10, 2014 I can certainly ask, but 2 things. 1. Why is this call exceeding the memory? 2. Why doesn't ONLY_PRODUCTS have the same problem? Link to comment Share on other sites More sharing options...
cdthomas23 Posted January 10, 2014 Author Share Posted January 10, 2014 Also, it looks like 128M may be the max I can go with my hoster. Link to comment Share on other sites More sharing options...
cdthomas23 Posted January 11, 2014 Author Share Posted January 11, 2014 I was able to increase to 256 MB and even 512 MB. The problem still exists when trying to use the above line to get ONLY_SHIPPING. Any other thoughts? Link to comment Share on other sites More sharing options...
NemoPS Posted January 11, 2014 Share Posted January 11, 2014 Try this: In that method, do something like "if ONLY SHIPPING is requested" die('here I am'); Try placing the die(); at the beginning, moving it down in the code when you see it works. Of course, you might want to run a debug backtrace to be sure you are targeting the right method call from your cartrule call 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