Hello All,
Currently I'm working on a new VM 2 plugin but I got one question that I hope some of you guys can answer, didn't found the answer on the forum or wiki yet.
At the moment I'm using the plgVmOnSelectPayment() function inside the new plugin. If I'm correct this could let you create your own radio input field or extra input fields needed for the payment method.
Now, can this also be used to create multiple input radio fields? Let's say a payment provider offers more then one payment method, can this function be used to create a list of all those payment methods offered by only that one Payment service provider using only this one payment plugin?
Hope someone knows the anser to this one.
Thanks,
Ruud
Hi,
The function that u should call is plgVmDisplayListFEPayment()
Actually that function should return an array for each payment methods.
Please have a look at paypal plugin from the J version.
Hello Alatak,
I'm using he paypal plugin as a reference but I can't see that function beeing used within the paypal plugin from the J version. ?
Hi,
Paypal is an extended class from vmPaymentPlugin.
You can find vmPaymentPlugin class in components/com_virtuemart/helpers/vmpaymentplugin.php.
And Paypal uses the default function from vmPaymentPlugin.
Hello Alatak,
Thanks, for the hint... I will take a look at it this weekend and let you know if I got it to work or not.
Hello Alatak,
I didn't got the time to finish the plugin but the project is now active again and I think something is different now with 2.0.6.
Using the function we talked about can I still do the following:
When I change a payment method there need's to be an onchange event that will show addional html when selecting this new payment method.
Do you (or someone else) know what is the best way of doing this?
Thanks for you help again.
Hi ,
I want exactly the same how hhe last post.
How can i use the plgVmOnSelectPayment function to show an html form if the payment is selected ?
Have anyone a sample code or plugin who uses such event trigger ?
Greetings uNkeLo
Hello
QuoteAt the moment I'm using the plgVmOnSelectPayment() function inside the new plugin. If I'm correct this could let you create your own radio input field or extra input fields needed for the payment method.
QuoteHow can i use the plgVmOnSelectPayment function to show an html form if the payment is selected ?
To display the payment method, you should use
function plgVmDisplayListFEPayment (VirtueMartCart $cart, $selected = 0, &$htmlIn)
$htmlIn[] is an array with all the forms for the payment.
Once the payment has been selected, use this function to check the data given by the client
public function plgVmOnSelectCheckPayment (VirtueMartCart $cart, &$msg)
You can look at the authorizenet payment plugin as an example
Hi ,
Thanks for yoru anwser.
But i dont still reeally know how to make if its check statement and include my own html. if its selected.
public function plgVmDisplayListFEPayment (VirtueMartCart $cart, $selected = 0, &$htmlIn) {
return $this->displayListFE ($cart, $selected, $htmlIn);
if ($selected == 1) {
echo "selected";
}
else
{
echo"notselected";
}
}
That snipped doesnt works.
I also dont know where it is $htmlIn defined.
If i remove $htmlIN in thereturn row then i have no radiobutton anymore with the payment method.
Eventually you can help with more hints i checked also the auhtorizenet but could not extract the sample code.
Hello
I wil do in a while a tutorial. I know i said that a long time ago .. but i must o it.
Look in your code
you do a return
return $this->displayListFE ($cart, $selected, $htmlIn);
so this code is never reached:
if ($selected == 1) {
echo "selected";
}
else
{
echo"notselected";
}
how to disable paypal if credit card is selected and vice versa thanks plz reply
??? they are radio buttons - thats what they do...