[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!

[PHP] How to get longest string from array ?

Hope it will save your time. Sometimes in PHP we may need to find the longest string from an array. So you can get this solutions in google but I made a function to make it more usable. It will return maximum lenght, key and the string form that array.

Clieck Here to see the code

Don’t forget to share!.

Cheers!

Listen LIVE Bangle Radio Stations with your VLC Player

So you want to listen your favourite Bangle Radio Stations like Radio Foorti or Radio Amar LIVE.

It doesn’t matter whether you are on Windows or Mac or Linux, use VLC Player

radio foorti

Step 1: Open VLC Player

Step 2: Click Media -> Open Network Stream (or Ctrl+N)

Step 3: Insert the Protocol as HTTP and Address as the ones listed here

Radio Foorti Dhaka, 88.0 FM: http://115.127.14.180:8000/
Radio Lemon24: http://115.127.14.58:8000/
Bangladesh Betar: http://123.49.36.26:1200
Radio Artonad: http://67.212.189.122:8070
Radio Goongoon: http://69.39.233.135:8032
Radio Apon: http://99.198.118.250:8150
Radio Aamar: http://203.202.253.56:8000

Step 4: Click Play and wait 5~6 seconds to buffer your desired Radio Station

ENJOY!!! 😉

[ubuntu] GrameenPhone’s Internet with Mobidata EDGE modem in ubuntu

Lot’s of UBUNTU users in Bangladesh are searching to configure Mobidata EDGE modem. Well, the most effective way to connect internet is wvdial. If it’s your lucky day then the following steps will work fine.

Step 1: First things first, make sure you are enable your repository from your software source.

Step 2: Now, in the terminal type

$ sudo wvdial

, If you are getting command not found that means you don’t have wvdialconf

For Ubuntu 9.10 (karmic koala) 4 files needed:

1. http://packages.ubuntu.com/karmic/i386/libwvstreams4.6-base/download
2. http://packages.ubuntu.com/karmic/i386/libwvstreams4.6-extras/download
3. http://packages.ubuntu.com/karmic/i386/libuniconf4.6/download
4. http://packages.ubuntu.com/karmic/i386/wvdial/download

All 4 files in .zip can be found (i386) into here

Update for Ubuntu 10.04
Although wvdial and dependencies are included into CD of 10.04 are NOT installed by default! Bug#400573
You do not need to download them, just use the .iso or LiveCD or LiveUSB following the procedure below:

1. right click ubuntu-10.04-desktop-i386.iso and ‘open with archive mounter’
(or mount LiveCD/LiveUSB)
2. right click on icon created (from 1) to ‘browse folder’
3. create a folder on Desktop (ex. named ‘wvdial’)
4. copy into that folder all 4 .deb files that exist into .iso/LiveCD/LiveUSB
… /pool/main/w/wvdial
and /pool/main/w/wvstreams
5. use System > Administration > Synaptic Package Manager
and then from menu File > Add downloaded packages > double click Desktop and then the folder you created at point #3, click open, follow instructions to
install

OR, you can got to step 5.

Step 3:If you can manage internet connection some how then go to terminal type

$ sudo apt-get install wvdialconf

Without installing PLEASE DON’T PROCEED.

Step 4: After installing wvdialconf you have a file name wvdial.conf in

/etc/wvdial.conf. Go to terminal type

$ sudo gedit /etc/wvdial.conf

. This will open the file with gEdit.

Step 5: Now copy and paste from below in /etc/wvdial.conf you are all most done!

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”gpinternet”
Modem Type = Analog Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/ttyUSB0
Username = xyz
Password = xyz
Baud = 460800
New PPPD = yes

Step 5: You are done! Go to terminal and try again

$ sudo wvdial

. Hope you can find [connect] word!!

[NOTE:] make sure that your Mobidata EDGE modem found in /dev folder like /dev/ttyUSB0 or whatever! just put the name correctly in the modem section.

Now you can enjoy your GrameenPhone’s Internet with Mobidata EDGE modem in ubuntu all the time.

Enjoy 😉

[php] use echo with parameters

Have you ever seen that echo can be used with parameters????
Oya!! This can be happen like:

<?php
$a = "Tanveer";
$b = "good at nothing";
echo "Hi my name is ",$a,". I am ",$b;
?>

Isn’t it so Funny!!!

[PHP] Dynamic function calling

People says PHP is flexible, Yes, really it is! Suppose you need to call function dynamical order. Here it is how?
The magic PHP function called call_user_func()

<?php
error_reporting(E_ALL);
function increment(&$var)
{
    $var++;
}

$a = 0;
call_user_func('increment', $a);
echo $a."\n";

call_user_func_array('increment', array(&$a)); // You can use this instead before PHP 5.3
echo $a."\n";
?>

Output will be :
0 1