News:

Looking for documentation? Take a look on our wiki

Main Menu

OpenGlobal VirtueMart PayPal Recurring Payments

Started by OpenGlobal, June 11, 2012, 17:03:48 PM

Previous topic - Next topic

OpenGlobal

Please use this thread to discuss the OpenGlobal VirtueMart PayPal Recurring Payments plugin for VM2:

http://www.openglobal.co.uk/shop/joomla/virtuemart/virtuemart-paypal-recurring-payments-detail.html

OpenGlobal

anthony

FIRST!! I'm trying to find a way to offer monthly AND yearly recurring payments for different products (or even the same product, if possible). FYI its a web hosting business - most products are monthly, but several are yearly.

The payment frequency is set globally in the plugin parameters.

I cannot find any VM payment module that can do this, but you would think this would be easy, and very popular!

Currently I'm looking at:

Setting up a custom field for the product - either hidden, or user selected - where the recurring frequency can be set. This will probably require some modification of the payment plugin to read the custom field (is that possible), and change the frequency setting accordingly. Sounds kinda easy?

I found another forum post that shows how setting a cookie can be used to change what payment plugins are visible in the cart process. This idea might work if the payment plugin was duplicated, with the duplicate set to the different frequency. http://forum.virtuemart.net/index.php?topic=107527.0 Unfortunately the use of cookies and javascript isn't something I'm very familiar with.

Really hoping that someone has already done this or that someone has some experience already in doing this and can offer some insight. I'm confident that I'll eventually solve it, but might take a long time.

I prefer the 1st method - using custom fields. Some help from experienced VM programmers would be much appreciated.

Also - FYI, my 1st support request to OpenGlobal (on a different matter) was responded to within TWO MINUTES!!! Awesome!

Thanks
anthony
The greater our mastery over language, the sharper the tools with which to dissect reality.

OpenGlobal

I think this is unlikely to be possible with VirtueMart because a user can add more than one product to the cart but only one payment plugin can be used in each order. If there is a payment processor which support recurring payments at different frequencies (to support yearly and monthly in the same order), then you may be in luck. But I'm not aware of any that offer this. It needs to be one frequency per order, and so one frequency per shop.

OpenGlobal

anthony

Hi OG,
Thanks for your input. Yes, it wouldn't make sense for most shops, but I'm working on two right now that (seem to) need just that type of functionality - shops which are only going to sell a single product/subscription at a time:

1. a hosting business - people very unlikely to buy more than one hosting package.
2. a Charity - people unlikey to buy more than one membership subsciption, but they need to offer choice of yearly or monthly subs.. No other products offered. These guys not using VM at moment. I've been searching for this functionality for them for ages. Even specific membership components don't seem to offer it, unless I've missed one. I figured best bet was to build a fancy form in Fabrik, or similar.

Anyway, I was looking at line 63:    'recurring_frequency' => array('', 'int'),

Had in mind to replace it with something 'simple' like:
   
if !(test for specific hidden Custom field value from item in cart) {
    'recurring_frequency' => array('', 'int'), }
else {
'recurring_frequency' = "12" ; }


Or similarly just changing the unit (from the default to year, or whatever)

Yeah, I know my php skills are a disaster. It's just a diagram. Planning on tackling this properly shortly. I should be able to figure it out eventually ...

The "test for specific hidden Custom field value from item in cart" is the specific bit that I thought someone from the community might shed light on - it might not be very easy ... not sure.

BTW, your plugin works fine - exactly as advertised. These are not bugs. I'm sure you have better things to do, but if you feel you can contribute to my understanding, then thats very welcome, but not expected.
The greater our mastery over language, the sharper the tools with which to dissect reality.

OpenGlobal

If you could find some way of ensuring that there was only ever one item in the cart (or at least only ever one subscription frequency), then it should be a fairly straight forward addition to any recurring payment plugin. The biggest problem is going to be restricting the cart.

OpenGlobal