Project

General

Profile

Plugin system » History » Version 1

Oscar van Eijk, 02/03/2011 09:40 AM

1 1 Oscar van Eijk
h1. Plugin system
2
3
Since VirtuaMart v2, the Joomla! plugin system is used form payment and shipper plugins.
4
5
h2. Installing plugins
6
7
During development the the VM2 branch, the plugins are not available as Joomla install packages, so for test environments, they must be installed manually.
8
9
h3. Payment plugins
10
11
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!!
12
13
Use the SQL query below to add the plugins to your database (assuming the table prefix is "jos_"):
14
15
<pre>
16
INSERT INTO `jos_plugins` (`id, `name`, `element`, `folder`, `access`, `ordering`
17
  , `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`)
18
VALUES
19
 (NULL, 'VMPayment - Authorize', 'authorize', 'vmpayment', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '')
20
,(NULL, 'VMPayment - Cash on delivery', 'cashondel', 'vmpayment', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00','')
21
;
22
</pre>
23
24
Next, copy the plugin files (authorize.php, authorize.xml, cashondel.php and cashondel.xml), located in the folder /plugins/vmpayment in the SVN checkout, to the Joomla plugin directory (if that doesn't exist, it must be created first: <pre>mkdir &lt;document_root&gt;/plugins/vmpayment</pre>).
25
26
Now, in the store maintenance, you can add payment methods based on one of these plugins. Note at this moment it is required to select a vendor!
27
28
h3. Shipper plugins
29
30
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.
31
32
Use the SQL query below to add the plugins to your database (assuming the table prefix is "jos_"):
33
34
<pre>
35
INSERT INTO `jos_plugins` (`id, `name`, `element`, `folder`, `access`, `ordering`
36
  , `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`)
37
VALUES
38
 (NULL, 'VMShipper - Standard', 'standard', 'vmshipper', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '')
39
;
40
</pre>
41
42
Next, copy the plugin files (standard.php and standard.xml), located in the folder /plugins/vmshipper in the SVN checkout, to the Joomla plugin directory (if that doesn't exist, it must be created first: <pre>mkdir &lt;document_root&gt;/plugins/vmshipper</pre>).
43
44
Now use the 'Shipping' menu item in the backend to add 1 or more carriers based on this plugin. 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).
45
Finally you can add the shipping rates for the created vendor. Make sure a there's always a valid shipping rate: customers select the carrier only and the plugin must be able to find a mathcing rate based on the total order weight and the shipto address!
46
47
h2. Writing plugins
48
49
For now, refer to the mainclasses for documentation. This info will be added here in a later stage.