Project

General

Profile

Plugin system » History » Revision 36

Revision 35 (ValĂ©rie Isaksen, 08/31/2011 12:34 PM) → Revision 36/42 (Patrick Kohl, 10/08/2011 03:35 PM)

{{>toc}} 

 h1. Plugin system 

 Since VirtueMart v2, the Joomla! plugin system is used form payment and shipper plugins. 

 h2. Installing plugins 

 During development the the VM2 branch, the plugins are not available as Joomla install packages, so for test environments, they must be installed manually. 

 h3. Payment plugins 

 At the time of writing, only 2 of the former payment plugins have been converted to the new plugin system. Others should follow soon, all help is appreciated!! 

 Use the SQL query below to add the plugins to your database (assuming the table prefix is "jos_"): 

 J1.5: 
 <pre> 
 INSERT INTO `jos_plugins` (`id`, `name`, `element`, `folder`, `access`, `ordering` 
   , `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`) 
 VALUES 
  (NULL, 'VMPayment - Paypal', 'paypal', 'vmpayment', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '') 
 ,(NULL, 'VMPayment - Standard', 'standard', 'vmpayment', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00',''); 
 </pre> 
 J1.6 or J1.7: 
 <pre> 
 INSERT INTO `jos_extensions` (`extension_id`,    `type`, `name`, `element`, `folder`, `access`, `ordering` 
   , `enabled`, `protected`, `client_id`, `checked_out`, `checked_out_time`, `params`) 
 VALUES 
  (NULL, 'plugin', 'plg_vmpayment_paypal', 'paypal', 'vmpayment', 1, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '') 
 ,(NULL, 'plugin', 'plg_vmpayment_standard', 'standard', 'vmpayment', 1, 0, 1, 0, 0, 0, '0000-00-00 00:00:00',''); 
 </pre> 

 For Joomla 1.5, when you did not use the svn checkout, copy the plugin files (paypal.php, paypal.xml, standard.php and standard.xml), located in the folder /plugins/vmpayment, to the Joomla plugin directory. If that doesn't exist, it must be created first. 

 For Joomla 1.6 or Joomla 1.7, when you did not use the svn checkout, create the folders paypal and standard in the folder /plugins/vmpayment, and then copy the plugin files (paypal.php, paypal.xml, standard.php and standard.xml) in the respective folder., located , to the Joomla plugin directory. If that doesn't exist, it must be created first. 

 Now, in the store maintenance, you can add payment methods based on one of these plugins, then click Apply button to display the appropriate parameters in the configuration tab. Note at this moment it is required to select a vendor! 

 h3. Shipper plugins 

 This is very similar to the payment plugins. Only 1 plugin has been created (again: all help is appreciated!); 'standard', which provides a basic shipping option for postal services. 
 *Note:* Installing the sample data does _NOT_ provide shipping rates anymore! 

 Use the SQL query below to add the plugins to your database (assuming the table prefix is "jos_"): 

 J1.5: 
 <pre> 
 INSERT INTO `jos_plugins` (`id`, `name`, `element`, `folder`, `access`, `ordering` 
   , `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`) 
 VALUES 
  (NULL, 'By weight, ZIP and countries', 'weight_countries', 'vmshipper', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '') 
 ; 
 </pre> 

 J1.6 or J1.7 
 <pre> 
 INSERT INTO `jos_extensions` (`extension_id`, `type`, `name`, `element`, `folder`, `access`, `ordering` 
   , `enabled`, `protected`, `client_id`, `checked_out`, `checked_out_time`, `params`) 
 VALUES 
  (NULL, 'plugin', 'plg_vmshipper_weight_countries', 'weight_countries', 'vmshipper', 1, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '') 
 ; 
 </pre> 
 For Joomla 1.5, when you did not use the svn checkout, copy the plugin files (weight_countries.php, weight_countries.xml), located in the folder /plugins/vmshipper, to the Joomla plugin directory. If that doesn't exist, it must be created first. 

 For Joomla 1.6 or Joomla 1.7, when you did not use the svn checkout, create the folder weight_countries in the folder /plugins/weight_countries, and then copy the plugin files (weight_countries.php, weight_countries.xml) in the respective folder., located , to the Joomla plugin directory. If that doesn't exist, it must be created first. 

 Now use the 'Shipping methods' menu item in the backend to add 1 or more shipping methods. Give a shipping method name, select the shipping method,and click Apply button to display the appropriate parameters in the configuration tab. All you need to do here is give the shipper a name and select a vendor (this is optional; when no vendor is selected, this carrier is valid for all vendors). 
 Make sure a there's always a valid shipping rate: the plugin must be able to find a matching rate based on the shipto address! 

 h2. Plugin Development 

 All plugins for VirtueMart should be developed confirming the Joomla! plugin development methods. Refer to http://docs.joomla.org/Tutorial:Plugins for developers documentation for Joomla! plugins. 

 h3. [[Payment Plugins]] 

 h3. [[Shipper Plugins]] 

 h3. [[Extension Plugins]] 

 h3. [[Calculation Plugins]] 

 h3. [[Product Plugins]]