Saturday, 24 March 2012

How to install vQmod on OpenCart?

What is vQmod?
"vQmod™" (aka Virtual Quick Mod) is an override system designed to avoid having to change core files. The concept is quite simple... Instead of making changes to the core files directly, the changes are created as xml search/replace script files. 

For example instead to change the template's header file catalog/view/theme/default/template/common/header.tpl,

it's much more safer to create script that will do the change.

The main benefit of using vQmod is that you can safely update opencart and you don't need to worry about all HTML/PHP patches and hacks that you have done on it. They are safely stored as xml scripts in /vqmod/xml folder. If there is any difference in the new OpenCart version you just have to set correct searching and replacing string in the xml script and it will work the same as before.


How to install using Autoinstaller - (Didn't work for me)

  1. Download the latest version that has "opencart" in the title from
  2. Using FTP, upload the "vqmod" folder from the zip to the root of your opencart store.
  3. Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777).
    • Also be sure index.php and admin/index.php are writable.
      • If not sure which you need, first try 755.
      • If you get errors about permissions, then try 777.
  4. Goto http://www.yoursite.com/vqmod/install
  5. You should get a success message. If not, check permissions above and try again
  6. Load your store homepage and verify it works.
  7. Using FTP, verify that there are new "vq" files in the "vqmod/vqcache" folder.
  8. If yes, then you are ready to start downloading or creating vQmod scripts, otherwise ask for assistance.
Done!


Well NOT DONE. 
This method didn't work for me, I deleted .htaccess file in the vqmod folder, but still wasn't able to access http://www.yoursite.com/vqmod/install. The browser kept saying Internal server error. 




How to install Manually - (worked for me)

Backup your main site / index.php and admin/index.php before continue.
  1. Download the latest version that has "opencart" in the title from
  2. Using FTP, upload the "vqmod" folder from the zip to the root of your opencart store.
  3. Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777).
    • Also be sure index.php and admin/index.php are writable.
      • If not sure which you need, first try 755.
      • If you get errors about permissions, then try 777.
  4. Edit your index.php file
  5. FIND:
  6. // 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');
  7. REPLACE WITH:
  8. // vQmod
    require_once('./vqmod/vqmod.php');
    $vqmod = new VQMod();
    // 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'));
Note the affiliate library file may not exist on older systems. Basically any require_once(DIR_SYSTEM . 'library/xxxxxxxx.php');needs to be changed to use the vqmod->modCheck above in the same format. This also applies to any additional require_once files in the next step
  1. Edit your admin/index.php file
  2. FIND:
  3. // 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');
  4. REPLACE WITH:
  5. // vQmod
    require_once('../vqmod/vqmod.php');
    $vqmod = new VQMod();
    // 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'));
  6. Load your store homepage and verify it works.
  7. Using FTP, verify that there are new "vq" files in the "vqmod/vqcache" folder.
  8. If yes, then you are ready to start downloading or creating vQmod scripts.
Done!

This method worked. The only warning to this method is that every time u upgrade your opencart you have to modify manually these 2 index.php files.


The next post I will publish some useful vQMod scripts

Monday, 12 September 2011

Web2Py - How to create custom view for register form, login form, profile form and even reset password form?

How to create custom view for register form, login form, profile form and even reset password form in Web2Py?

If you want to manage and customize the authentication forms in web2py.

Let's say you wanna add more fields and make the profile more complete.
You need to overload the default user table and to add more fields to it. After that you have to create, controllers and views for login, register, profile , password reset.

Sunday, 26 June 2011

Simple SVG driven Radar using Raphael JS graphic library

I was playing with Raphael last month and decided to share what I have done.
It's Animated Radar
the source code is on github
I did the SVG part in Inkscape. exported to plain SVG format and after that had look at SVG file.
For more info, docs,examples -> rahpael and SVG


   
   

Sunday, 20 March 2011

The simplest way to use GitHub on Windows 7 with GUI

I tried some git clients, I read loads tutorials. Now I am going to write about simpliest and easiest way to commit, pull, push and clone code files using Git respository and particularly GitHub.com.

I tryed these 4:
Cygwin + git + ssh. It worked. But Its console based.
msysgit + putty stuff. Partly worked. Issue with ssh certificates
TortoiseGit - Tortoise didnt work for me too. Only  clone function.
GitExtensions - It's using msysgit  + Kdiff external programs. Its GUI based interface. But I couldn't make it work.


After these trials. I removed all software. Deleted all folders and C:\users\username\.ssh folder where rsa keys are stored.