I have a new CartThrob installation on EE 2.9, everything seems to be working just fine apart from when I use {exp:cartthrob:cart_items_info} in my cart template.

Without that tag the page loads in 1/2 seconds, but with the tag in place the page loads after about 20-30 seconds. This delay gets worse if there are more items in the cart.

I have taken a look in mod.cartthrob.php that holds the cart_item_info function in order to try and pinpoint some way of improving the speed.

Surely these load times aren't to be expected?

Here's the snippet from the Template Debugger which shows the time jump...

(0.271300 / 2.43MB) -> Class Called: Cartthrob
(0.276118 / 2.44MB) -> Method Called: cart_items_info
(11.682038 / 3.55MB) -> Data Returned
(11.682083 / 3.53MB) - End Tag Processing 

Any help anyone could give me would be greatly appreciated.


I have stripped out everything else in the template, leaving just the following:



Even with just this code the problem still persists.

Debugging the call stack a little more the cart_item_info() function in mod.cartthrob.php appears to run relatively quickly until line 3402: $return_data = $this->EE->template_helper->parse_variables($data);

This is where the delay seems to be.

Edit 2:

Just to ensure nothing had gone wrong with the original installation and setup, I have just done another fresh install of both EE and CartThrob. The cart still loads just as slowly using the default sample templates provided by CartThrob.

  • Not happening here with some pretty complex cart stuff. maybe post the actual template code? – Jeremy Daalder Aug 7 '14 at 2:06
  • Thanks for the reply @JeremyDaalder. I've updated my post with a little more information. – Scott Wakefield Aug 7 '14 at 7:39
  • That's just odd. What's actually in the cart at that point ? Maybe an oddity in custom data? Are you sure on PHP version etc? (i.e. you've tried another install, what about another server?) – Jeremy Daalder Aug 7 '14 at 22:48
  • I know this post is a few years old but I figured I would chime in as I am experiencing the same slow tag parsing for CartThrob tags. The queries behind the tags aren't slow so I am not sure what's up. I've tried a few different PHP versions AND I updated CartThrob and that didn't help. – Benjamin Kohl Dec 1 '16 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.