News:

Support the VirtueMart project and become a member

Main Menu

Documentation for plugin development

Started by _oscar_, February 07, 2011, 16:32:49 PM

Previous topic - Next topic

_oscar_

Hey all,

There's a new page in our Wiki that describes the new plugin system for VirtueMart 2.
As you've probably seen before, it now uses the Joomla! plugin structure; there are some base classes for creating shipper- and payment plugins available.

If you wanna help VM by creating new plugins or converting VM1.1.x plugins to VM2; I'll buy you a beer (and even drink it for you :) )

For documentation, please have a look at http://dev.virtuemart.net/projects/virtuemart/wiki/Plugin_system
Any comments, just drop'm here!

stAn99

Hello Everybody,
i analyzed VM2 (beta2, quick look at beta3) plugin system, and i would like to recommend to use own JInstall adapter for installing plugins with type="vm_ext". The advantage of own adapter is that we could use two sql inclusion files in manifest XML one for joomla 1.5 and the other for joomla 1.6. Also if the plugins would be saved as type adapter's type, they would not have to be in JPATH_PLUGINS directory where we don't really want to store them.

Also many VM extensions for VM 1.1.x are based on modifing ps_checkout->add( ps_checkout->process( functions of checkout processing. These are usually various coupon systems and payment systems. Will there be any possibility how can one particular function of VM2 can be overriden with 2 different plugins? 
----
RuposTel.com
www.rupostel.com
Your customized checkout solution for Virtuemart

Milbo

Quote from: stAn99 on March 06, 2011, 13:50:03 PM
they would not have to be in JPATH_PLUGINS directory where we don't really want to store them.
Why we do not really want to store them there? I am confident with using the general joomla plugin directory.

Quote from: stAn99 on March 06, 2011, 13:50:03 PM
Also many VM extensions for VM 1.1.x are based on modifing ps_checkout->add( ps_checkout->process( functions of checkout processing.
This function does not longer exist. All this extensions must be rewritten using joomla event hooks.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Minh BlackRed

@_oscar_:
http://dev.virtuemart.net/projects/virtuemart/wiki/Plugin_system
"Since VirtueMart v2, the Joomla! plugin system is used form payment and shipper plugins"
---
There has no plugin to control display of product on front-end?
VM Responsive
shop.littledevil-tuning.com

_oscar_

Quote from: ojb on March 21, 2011, 04:17:16 AM
There has no plugin to control display of product on front-end?

Not yet. There will be more events supporting more plugin types. There are a few undocumented ones already in the backend, but no plugins have been written for those events and therefore they can't be tested.
It's not planned to add more events for 2.0; after that release the plugin system will be expanded.

Dade

Oscar, you mean that if I try to create a plugin (for payment in my case) it won't be showed on the payment check on the front-end?

I'm asking because I'm trying to do a plugin for payments with AUP but since I activated it it gives me an error on the edit payment page (task=editpayment). It's because what you mentioned or simply because it's not written properly (I mean my plugin :P).

Thanks for your time!

_oscar_

I answer this because you direct your question to me, but I left the VM project team about 3 months ago.
I'm not sure what happened with the plugin system since then, but from what I understand from your question.... it's not properly written ;)

Payment plugins should appear in the frontend on checkout, unless anything changed there over the last few months, but then there might be simply a bug that I'm sure someone in the team will pick up

Milbo

Haha oscar, what your writing?

You know very good, that this part was "done" as you left, and that you continued my work and was the last one who wrote on it before you left the team. On of the first things I added to the vmpayment plugin is the selfdisplaying on the frontend.

But to get the paypal plugin working we had to add some important stuff and rewrite some code, thats true. I suggest Dade should take a look on the wiki, the cash on del and the paypal plugin to understand how it is working.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

alatak

#8
Hi,

Quoteyou mean that if I try to create a plugin (for payment in my case) it won't be showed on the payment check on the front-end?

They do appear on the frontend. When you create a payment method, by default it is not published. Could this be the problem?

cmarkell

Is the wiki accurate still? In the current svn version the plgVmOnSelectPayment has become xxxplgVmOnSelectPayment and doesn't appear to be being used to output the select option during checkout... I'm trying to add credit card form fields, is this still the way?

alatak

Hi,

No, i am actually doing it.

The xxxplgVmOnSelectPayment is an obsolete function. I will remove it now .

f.janssen

If plgVmOnSelectPayment  is obsolete, how can I then add extra parameters which are needed for my payment plugin ?

Also, I do think these changes are kinda big if, VM2 is production ready.
I think I should wait some months for actually using this software or am I mistaken ?

Kind regards,
Fred
Kind Regards,
Fred

alatak

Hi,

The function plgVmOnSelectPayment() is not obsolete.
It is the one which i had in the code xxxplgVmOnSelectPayment() which should not have been on the code.


alatak

Hi

Yes it is down.
We are trying to fix the problem.