How to speed up Virtuemart

Yesterday I got a support ticket where a site with Virtuemart, generated around ~1400 SQL queries per request. There were around 500 categories in that shop and it causes the slow loading problem.

I forgot to tell, but he used CSS Menu for VirtueMart. Then we tried it with the Accordion Menu for Virtuemart, less queries (around ~1000), but it is enough for a speedy webshop...

I know Accordion Menu for Virtuemart in and out and I know that there is only one SQL query, so there is no problem. The problem must be in Virtuemart system. The url generation for each category took a lot of query. Every time a category tried to find and Itemid, it made a query to the database. It is not good. 500 categories = 500 query, just for a menu...

I do not want to bore you, so here is the solution for this huge issue.

Open administrator\components\com_virtuemart\classes\ps_session.php
Find the following code
and replace with this
Save the file and check the result

After this modification on the previously mentioned site, it produce only 14 query, which is far better.

It is tested on Joomla 1.5 and Virtuemart 1.1.6. Please try it on other environments and tell me if it is working or not in your configuration.

Related Post

Accordion Menu Theme Management System

The Premium Theme packs in version 4 was a little bit limited, you were able to choose from pre-prepared color variations. We recognized the obstacles and made an awesome Theme Management System fo...

More

Accordion Menu is spreading to Tienda

After the Joomla, Virtuemart and redShop Accordion Menu I would like to announce the new Accordion Menu for Tienda.

...
More

Comments

Guest
virtuemart developers in India
Monday, 12 December 2011

It's great information. Thanks for posting.

Leave your comment

Guest
Guest
Thursday, 17 May 2012
(required)
(required)
(required)