VirtueMart Forum

VirtueMart 2 + 3 => Plugins: Payment, Shipment and others => Topic started by: vmfyelloq19 on August 13, 2019, 11:46:57 am

Title: Payment method plugin with user input field
Post by: vmfyelloq19 on August 13, 2019, 11:46:57 am
Hi folks,

I need to have a user input field for a payment method, baisally a text input filed that's presented when the payment method is selected.
( ) paypal
() other 1
(x) my payment method
     Please enter code [___________]

Any hints?

TIA!
Title: Re: Payment method plugin with user input field
Post by: GJC Web Design on August 13, 2019, 16:17:25 pm
you can over ride the protected function getPluginHtml () and provide a field but I assume there is a lot more to it than that.. what is the field supposed to do?
Title: Re: Payment method plugin with user input field
Post by: vmfyelloq19 on August 13, 2019, 18:53:51 pm
Hi GJC Web Design,

thank your for your reply.
This particular "payment method" just needs to pass a string with the customer's account number along with the order.
A shopper field would be fit the case better, as it would be stored into the customer's profile, but shopper fields are not be conditional for the specify payment method.

Cheers!
Title: Re: Payment method plugin with user input field
Post by: GJC Web Design on August 13, 2019, 23:18:17 pm
in that case u could use some JS to show/hide and enforce the shopper field if that radio is chosen
Title: Re: Payment method plugin with user input field
Post by: vmfyelloq19 on August 14, 2019, 08:49:59 am
I never use Javascript for required functionality, as it is possibly disabled.

Cheers!
Title: Re: Payment method plugin with user input field
Post by: jenkinhill on August 14, 2019, 11:29:17 am
I never use Javascript for required functionality, as it is possibly disabled.

As VirtueMart makes heavy use of JavaScript then AFAIK someone with js "disabled" would be unable to use the store, anyway.