Add Top Categories in Right side bar through the vQmod in Opencart

Some times if we are integrating the Custom theme / HTML in Opencart, we want to display the Top label Categories in the Right side bar. Here is the vqmod script by which you can display the top label categories in the Right Side bar. Follow the steps below:

Step 1 : Use/Copy the code below:

<!--?xml version="1.0" encoding="UTF-8"?-->

Add Categories module to Right side bar

        <![CDATA[         $this->load->model('catalog/category');
        $this->data['categories'] = array();
        foreach ($this->model_catalog_category->getCategories() as $result) {
            $this->data['categories'][] = array(
		'category_id' => $result['category_id'],
                'name' => $result['name'],
		'href'  => $this->url->link('product/category', 'path=' . $result['category_id'])

Step 2 : Paste it in the file and save it with the name add_categoriess_to_right.xml
Step 3 : Upload the add_categoriess_to_right.xml by using the vqmod or directly by using the FTP on this location /vqmod/xml

Step 4 : Copy the below code

<!--?php if ($categories) { ?--></pre>
<div class="category-list">

<!--?php } ?-->

Step 5 : Now open the column_right.tpl by navigating to catalog -> view -> theme -> [your_custom_theme] -> template -> common and Paste the above code at the Top of this file. Refresh the Vqmod cache through the admin panel and you have done.

Hope this will help to someone.