5/5 - (1 vote)

If you start developing for the project or just with VirtueMart you can set up a development environment with an IDE and a SVN program.

We recommend you to use two programs below for working with VirtueMart and synchronizing the working directory with the local SVN repository:

  • SmartSVN or TortoiseSVN http://tortoisesvn.net/downloads.html
  • Eclipse for php or aptana (very good PHP IDE and free!)

1. Setup an IDE and SVN

Use NOT the standard jos_ prefixed, please use something new, here we use jos_. This helps to find hardcoded prefixes. You should use another one.

You should install your Joomla in a domain with a subdomain and path, EX: shop.localhost/vm2/. This helps to find path problems.

To setup up an IDE, please follow the explanations here: http://docs.joomla.org/Setting_up_your_workstation_for_Joomla!_development

2. SVN-BASICS

The SVN folder structure is setup with 3 root folders:
– Trunk: used for current active development.
– Tags: used for public releases.
– Branches: used for code branches.

The structure found under these root folders mimic the structure in a typical Joomla installation, however, only contain the VirtueMart code.

There are 3 different folders for backend, frontend, modules, and plugins

trunk/virtuemart/administrator/components/com_virtuemart ;pure vm
trunk/virtuemart/administrator/language ;mixed
trunk/virtuemart/components/com_virtuemart ;pure vm
trunk/virtuemart/language ;mixed
trunk/virtuemart/plugins ;mixed
trunk/virtuemart/plugins/vmcustom ;pure vm
trunk/virtuemart/plugins/vmpayment ;pure vm
trunk/virtuemart/plugins/vmshipment ;pure vm
trunk/virtuemart/modules/ ;mixed
The /trunk is your joomla base root = jRoot.

If you have a joomla installation and make 1 checkout for back and frontend. Use for checkout on the joomla base root:

svn co https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart

After updating you should have the newest version of VirtueMart. Use at best daily the “Install tables or if necessary update them” function .

Note: When you use j1.5 you must copy the plugins from the subfolder manually (weight_countries.php and weight_countries.xml in to the parent direcotry). Because j1.5 expects the plugins in the folder of the “plugin family” like vmpayment. But j1.7 stores the plugins in the family folder and in its own folder for exampel vmpayment/paypal.

Installation of VirtueMart into your IDE

Use the VirtueMart installer to set the right entries for using VirtueMart

Try one of two ways below:

Follow these steps:

  1. Transfer Joomla files in a directory
  2. Install Joomla to create the database
  3. Install VM with the installer to install VM tables in the database [[Create virtuemart installer]].
  4. Download also the all-in-one payment plugin installer at http://dev.virtuemart.net/projects/virtuemart/files
  5. Checkout VM in an empty directory (You need to call that directory virtuemart to fit the name from SVN directory structure)),
  6. Transfer Joomla files in the directory called virtuemart
  7. change Joomla configuration file with the database name given on step 2, and give the correct tmp path.

In this way, you can use the virtuemart installers, however, you need to handle two different directory in your http directory and edit the configuration file.

or use them:

You just delete the virtuemart files after the installation to be able to perform the checkout.

  1. This means download or create the installer of virtuemart and install it in joomla [[Create virtuemart installer]].
  2. Download the all-in-one payment plugin installer at http://dev.virtuemart.net/projects/virtuemart/files
  3. You should delete the files that are installed by the vm installer before you can checkout the svn. Just delete this directories
    administrator/components/com_virtuemart
    components/com_virtuemart
    plugins/vmpayment
    and to prevent warnings the language files named en-GB.com_virtuemart.ini in
    administrator\language
    language
  4. Configure the SVN, directly into your joomla base directory.

In this way, you can use the virtuemart installers and delete the right files.

Use manual installation and the right SQL to inform Joomla that VirtueMart exists.
  1. Open your IDE and make a project (call it for exampel vm2)
  2. Set httpd directory to the parent directory (workspace) and best with subdomain like shop.localhost/vm2
  3. Checkout the svn
  4. Copy joomla files into “workspace/vm2” , of course just merge the directories, when it is asking. There must be a merge, but no override of files. Note for mac users, use this tool to merge directories http://www.mucommander.com/
  5. Use the right sql to inform joomla that virtuemart exists.
  6. Execute the following sql commands with phpmyadmin. These sql assume that you use the prefix jos for your tables. for joomla 2.5 use the discover feature !!

This is for virtuemart:
Joomla 1.5

public function __construct (&$subject, $config=array()) {
parent::__construct($subject, $config);
$this->_path = JPATH_PLUGINS.DS.$this->getName();
JPlugin::loadLanguage('plg_vmextended_'.$this->getName());
}

Joomla 1.6/j1.7

INSERT INTO `jos_extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES(10007, 'virtuemart', 'component', 'com_virtuemart', '', 0, 1, 0, 0, '{"legacy":true,"name":"VirtueMart","type":"component","creationDate":"May 2011","author":"The VirtueMart Development Team","copyright":"\\tCopyright (C) 2011 The Virtuemart Team. All rights reserved.","authorEmail":"team|at|virtuemart.net","authorUrl":"http:\\/\\/www.virtuemart.net","version":"2.0.0","description":"Online-Shop \\/ Complete E-Commerce system for Joomla 1.6","group":""}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0);

and

INSERT INTO `jos_menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `ordering`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`) VALUES(465, 'main', 'VirtueMart', 'virtuemart', '', 'virtuemart', 'index.php?option=com_virtuemart', 'component', 0, 1, 1, 10007, 0, 0, '0000-00-00 00:00:00', 0, 1, '../components/com_virtuemart/assets/images/vmgeneral/menu_icon.png', 0, '', 277, 278, 0, '', 1);

after that use “/administrator/index.php?option=com_virtuemart&view=updatesmigration” and choose there “Reset all tables
and install sampledata” to install the virtuemart tables.

If you have any question about this post, don’t hesitate to leave a comment below. And don’t forget to share with your friends if you find it useful! Thanks!

Leave a Reply

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

Save 99% money with single purchase! Get All-In-One DEV package: Access all paid products! Unlimited Downloads with more than 300+ PRO items Sign Up Now!
Black Friday & Cyber Monday Sale! Get 50% OFF for your purchase on today! Coupon code: BFCM50 Redeem Now