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

Improved Virtuemart search plugin

The default Virtuemart plugin for Joomla contains a serious bug. The bug is usually come out if you use different Itemids for different categories or product.

...
More

How to manage search plugins for Universal AJAX Live Search?

During the developement of Universal AJAX Live Search we tried to produce an extension, which has a wide range of usability and it isn't limited for a single webshop-engine.

...
More

Comments

Guest
virtuemart developers in India
Monday, 12 December 2011

It's great information. Thanks for posting.

Guest
industrial training indore
Tuesday, 19 June 2012

I have read your blog and i got a very useful and knowledgeable information from your blog.its really a very nice article.You have done a great job .

Thank you so much for sharing.

industrial training indore

Leave your comment

Guest
Guest
Sunday, 24 September 2017
(required)
(required)
(required)

Find Us on Facebook