Custom field on checkout for specific payment type

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #69678

I need a custom field in the checkout that should only be displayed when the customer chooses a specific payment method.

When this payment method is selected the field should be shown for the customer to fill in. It could be stored in the order or in the user table. Maybe ordertable is easier in this case. And then this field is required.

Is there some filtering options that can be used?


Thanks

Jan

Last edit: 12 years 1 month ago by jansuhr.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #69777

Hi Jan,

I think that you have to create a custom field in the table "Checkout", in the checkout check the class of the custom field, add a css property to hide it, and in the "checkout / payment" view add some JavaScript to display this class if the specific payment method is selected.

The custom field and payment method must be in the same step in the checkout.

Please Log in or Create an account to join the conversation.

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #69805

Yes that would probably work.

Since this field should be required when this payment method is selected, how would that influence the other payments when it is hided. It would still be required but hidden and then prevent the other payments to go to the next step, right?


Jan

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #69807

If this field is required, with the other payment method it will not be possible to go to the next step.

Why not set a default value in this field when another payment method is selected, and clear the value when the specific payment method is selected ?
In the same JS code that I talked about before ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum