:)

Increase the speed on loading the opencart sites

I am working as the opencart programmer since 6 month and found out that opencart as the best opensource for the e-commerce site.
Yet some of the things to be taken into consideration which obviously increase the speed of the opencart sites.

We all know that indexing the table increase the performance of the database so creating the following index really increase the speed in the opencart sites. Run the query below and enjoy some little speed on loading your sites.

ALTER TABLE category ADD INDEX ( parent_id ) ;
ALTER TABLE category ADD INDEX ( top ) ;
ALTER TABLE category ADD INDEX ( sort_order ) ;
ALTER TABLE category ADD INDEX ( status ) ;
ALTER TABLE option ADD INDEX ( sort_order ) ;
ALTER TABLE option_description ADD INDEX ( name ) ;
ALTER TABLE option_value ADD INDEX ( option_id ) ;
ALTER TABLE option_value_description ADD INDEX ( option_id ) ;
ALTER TABLE order ADD INDEX ( customer_id ) ;
ALTER TABLE product ADD INDEX ( model ) ;
ALTER TABLE product ADD INDEX ( sku ) ;
ALTER TABLE product ADD INDEX ( upc ) ;
ALTER TABLE product ADD INDEX ( manufacturer_id ) ;
ALTER TABLE product ADD INDEX ( sort_order ) ;
ALTER TABLE product ADD INDEX ( status ) ;
ALTER TABLE product_option ADD INDEX ( option_id ) ;
ALTER TABLE product_option_value ADD INDEX ( product_option_id ) ;
ALTER TABLE product_option_value ADD INDEX ( product_id ) ;
ALTER TABLE product_option_value ADD INDEX ( option_id ) ;
ALTER TABLE product_option_value ADD INDEX ( option_value_id ) ;
ALTER TABLE product_tag ADD INDEX ( product_id ) ;
ALTER TABLE product_tag ADD INDEX ( tag ) ;
ALTER TABLE url_alias ADD INDEX ( query ) ;
ALTER TABLE url_alias ADD INDEX ( keyword ) ;
ALTER TABLE user ADD INDEX ( username ) ;
ALTER TABLE user ADD INDEX ( password ) ;
ALTER TABLE user ADD INDEX ( email ) ;

 

Likewise we have to remove unnecessary queries which obviously increase the speed of the site.

Queries that can be removed are the category count in the opencart

You can use the opencart extension to remove the product category count http://www.opencart.com/index.php?route=extension/extension/info&extension_id=4246 or just use the steps below:

Go to the file:
/catalog/controller/module/category.php
1.Search CODE:

'name'        => $child['name'] . ' (' . $product_total . ')',

Replace with CODE:

'name'        => $child['name'],

2.Search CODE:

'name'        => $category['name'] . ' (' . $product_total . ')',

Replace with CODE:

'name'        => $category['name'],
3. Search CODE:
'name'  => $result['name'] . ' (' . $product_total . ')',
Replace with CODE: 
'name'  => $result['name'],

 

This will remove the product count in category module.
If there is product count in the top menu bar then you can remove them as well
For the top bar go to
/catalog/controller/common/header.php

Search CODE:

'name'  => $child['name'] . ' (' . $product_total . ')',
And Replace with CODE: 
'name'  => $child['name'],

 

Incoming search terms:

Related posts:

Tags: , ,

One comment

  1. thanks for great advice this is for certain the best advise I have seen on opencart speedup

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>