[Opencart] Url Alias extension for SEO

This is an extension for opencart. User can add, edit or delete any SEO friendly url for their site. For your informatin this is my first MIT License opencart extension. If you find this usefull or any bug please let me know through this post.

logo.1

CMSPACK :: URL ALIAS
Contributor: “Tanveer Noman”<tanveer.noman@gmail.com>
Blog: neeocis.wordpress.com
Tags: cms, opencart, url, alias, seo
Requires at least: 1.5.5.1 or later
Tested up to: 1.5.5.1
Stable tag: url alias
License: This content is released under the (http://opensource.org/licenses/MIT) MIT License.

Click to Download

Description
This extension is under CMS PACK for opencart store. User can create any desired SEO friendly url alias with this. Very easy to use. What you need just go to the “Url Alias” from Extension and then insert, edit or delete any alias.

Installation
Copy cms folder to it’s desired folder in the admin section. You need to change some files also (as vqmod is not currently available). But I can assure you it will provide soon. Download from here

Step 1: Backup all your data and source code.

Step 2: Login to admin panel. Go to System > Settings. Click “Edit” of your store. Select “Server” tab. Select “Use SEO URL’s” -> Yes and save.

Step 3: Go to your root folder and rename the file .htaccess_text to .htaccess. These lines of this file should be uncommented.

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Step 4: unzip CMSPACK.zip file. Copy cms folder as per belonging folders like controller, language, model, view.

Step 5: Upload ‘vqmod/xml/admin_menu_modification.xml’ file to vQmod xml directory.

Or,

Step 5: If you don’t have vQmod right now, You need to edit these following files

//1.
//File: admin/controller/common/header.php 
//search this line 
$this->data['text_product'] = $this->language->get('text_product'); 
//add after that line
$this->data['text_url_alias'] = $this->language->get('text_url_alias');
//search this line 
$this->data['product'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'], 'SSL');
//add after that line
$this->data['url_alias'] = $this->url->link('cms/alias', 'token=' . $this->session->data['token'], 'SSL');
//2.
//File: admin/language/english/common/header.php 
//search this line 
$_['text_product']                     = 'Products';
//add after that line
$_['text_url_alias']				   = 'Url Alias';
//3.
//File: admin/view/template/common/header.tpl
//search this line 
<li><a href="<?php echo $feed; ?>"><?php echo $text_feed; ?></a></li>
//add after that line
<li><a href="<?php echo $url_alias; ?>"><?php echo $text_url_alias; ?></a></li> 

Upcoming Modules

* Form Manager: Create and add any form you want to any page in your store.
* Menu Manager: Manage your admin menu right away.
* gFeed Manager: Google Spreadsheet synchronization with opencart. It can load categories, manufactures, products from google spreadsheet.
* Report Manager: Manage your sells, quick view and generate report
* Ad Manager: Advertise products via SMS, Email and ad server

Help and Support
If you have any comments,feedback and or need any help to use this extension please comment below

Fork in Github
If you want to contribute you can fork here
https://github.com/tanveer-noman/oc-cms-url-alias

Changelog
1.0.1: resolving “text_url_alias” shows when user in the dashboard
1.0.2: vqmod xml file has been added to show ‘Url Alias’ menu item under Extentions admin menu

[OpenCart] how to install vQmod in OpenCart ?

opencart

Today, I came up here to make some easy pictures to install “vQmod” (Create xml patches for php files without editing the core system source code so called Virtual file modification system) in OpenCart 1.5.5.1

If you don’t know what is vQmod? then please read before we start.

vQmod: Virtual file modification system

Assume, we have installed a fresh copy of OpenCart 1.5.5.1 in the system

In this tutorial there are more than one way that vQmod can be installed in the opencart system.

Install vQmod in OpenCart manually:

Step-1: For self securitey! Backup or make a duplicate of your existing installed OpenCart files and folders in safe place.

Step-2: Download the latest version of vQMod

Step-3: Extract vqmod-x.x.x-opencart.zip and upload the vqmod folder to root of OpenCart directory.

Step-4: Now, we need to modify two files. One is /index.php and another one is /admin/index.php file

Search,

//File: /index.php 
// Startup
require_once(DIR_SYSTEM . 'startup.php');

// Application Classes
require_once(DIR_SYSTEM . 'library/customer.php');
require_once(DIR_SYSTEM . 'library/currency.php');
require_once(DIR_SYSTEM . 'library/tax.php');
require_once(DIR_SYSTEM . 'library/weight.php');
require_once(DIR_SYSTEM . 'library/length.php');
require_once(DIR_SYSTEM . 'library/cart.php');
require_once(DIR_SYSTEM . 'library/affiliate.php');

Replace with,

// vQmod
require_once('./vqmod/vqmod.php');
VQMod::bootup();

// VQMODDED Startup
require_once(VQMod::modCheck(DIR_SYSTEM . 'startup.php'));

// Application Classes
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/customer.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/currency.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/tax.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/weight.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/length.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/cart.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/affiliate.php'));

and,

Search,

//File: /admin/index.php
// Startup
require_once(DIR_SYSTEM . 'startup.php');

// Application Classes
require_once(DIR_SYSTEM . 'library/currency.php');
require_once(DIR_SYSTEM . 'library/user.php'));
require_once(DIR_SYSTEM . 'library/weight.php');
require_once(DIR_SYSTEM . 'library/length.php');

Replace with,

// vQmod
require_once('../vqmod/vqmod.php');
VQMod::bootup();

// VQMODDED Startup
require_once(VQMod::modCheck(DIR_SYSTEM . 'startup.php'));

// Application Classes
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/currency.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/user.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/weight.php'));
require_once(VQMod::modCheck(DIR_SYSTEM . 'library/length.php'));

Step-5: vQmod is now ready to use. Upload desired xml script to ‘vqmod/xml’ folder

Step-6: How this .xml file should look? For exampale we need to add a menu item “Homenet” under “Extension” menu in the admin panel. So we need to create a file named admin_menu_modification.xml in ‘vqmod/xml’ folder like;

‘vqmod/xml/admin_menu_modification.xml’

<!--
#author: Tanveer Noman
#file name: admin_menu_modification.xml
#description: This file is demonstrating how to write a simple xml file to add new
menu item named "Homenet" in admin menu section
-->
<modification>
	<id>Admin Menu Modification</id>
	<version>1.5.x</version>
	<vqmver>2.2.1</vqmver>
	<author>tanveer.noman@gmail.com</author>
	<file name="admin/controller/common/header.php">
		<operation>
			<search position="after"><![CDATA[$this->data['text_feed'] = $this->language->get('text_feed');]]></search>
			<add><![CDATA[$this->data['text_homenet'] = $this->language->get('text_homenet');]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[$this->data['feed'] = $this->url->link('extension/feed', 'token=' . $this->session->data['token'], 'SSL');]]></search>
			<add><![CDATA[$this->data['homenet'] = $this->url->link('homenet/homenet', 'token=' . $this->session->data['token'], 'SSL');]]></add>
		</operation>
	</file>
	<file name="admin/view/template/common/header.tpl">
		<operation>
			<search position="after"><![CDATA[<li><a href="<?php echo $feed; ?>"><?php echo $text_feed; ?></a></li>]]></search>
			<add><![CDATA[<li><a href="<?php echo $homenet; ?>"><?php echo $text_homenet; ?></a></li>]]></add>
		</operation>		
	</file>
	<file name="admin/language/english/common/header.php">
		<operation>
			<search position="after"><![CDATA[$_['text_feed']                        = 'Product Feeds';]]></search>
			<add><![CDATA[$_['text_homenet']                     = 'Homenet';]]></add>
		</operation>		
	</file>
</modification>

Wallah! You are done!

Step-7: Now log in to admin panel. Mouse over to “Extension” menu item, if everything works good then you can see a new menu item “Homenet” is added whithout changing any core system files.

homenet

Install vQmod in OpenCart using Autoinstaller:

Step-1: Download the latest version of vQMod and extract it.
Step-2: Use your FTP to upload the folder “vqmod” to your opencart store. Make sure vqmod/vqcache folders are writable (either 755 or 777).
Step-3: Now browse http://www.your-domain.com/vqmod/install
Step-4: If everything goes well, you should get a success message. If not then check permissions.

***Troubleshooting***
– Make sure you are giving the currect vqmod path like; require_once(‘../vqmod/vqmod.php’);
– Check if the vqmod folder and the vqmod/vqcache folders are writable (755)
– Verify that there are new “vq2” files in the “vqmod/vqcache” folder after loading your store homepage
– Some times you may need to create “mods.cache” file inside “vqmod” folder and make it writable (755)
– You may need to create logs” folder inside “vqmod” folder and make it writable (755)

For more information:

http://docs.opencart.com/display/opencart/OpenCart+1.5+Home
http://www.opencart.com/index.php?route=extension/extension
http://forum.opencart.com
https://github.com/opencart/opencart/issues
http://opencart.hostjars.com
http://opencart-help.com

Related Links:
[Video] http://code.google.com/p/vqmod/wiki/Install_OpenCart

That’s all!

You can inbox me or drop your comments/feedbak here I will reply on that regards.

Thanks for reading and don’t forget to share!

%d bloggers like this: