2
Answers
Vote up!
0
Vote down!

Add Two Field into Example Payment Module

Hello Guys,

I am new to drupal & commerce and learning drupal commerce from last month. For my payment purpose I only need to add two extra field into example payment module (e.g. Employee ID, and Join Date). And also show user submitted data into back-end (store -> order -> Payment -> view) to verify.

Payment method
Remote ID
Message -> ( to Name)
Amount
Status

Employee ID,
oin Date

Please help me with code, If you can. Actually I don't know how to write code for drupal.

Thanks for reading.

Asked by: jakaria
on September 25, 2013

2 Answers

Vote up!
0
Vote down!

Hi

Do you want to add fields in billing or shipping information.In that case
please go to
admin/commerce/customer-profiles/types

Here you can add more fields

Thanks

Ajai

Answer by: ajaichandran
Posted: Sep 25, 2013

Comments

Dear Ajai,

I want to add field to Payment (Example payment Module), How I duplicate below code (line #36 of commerce_payment_example.module), to show 3 different field :

// Merge in default values.
$pane_values += array(
'name' => '',
);

$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#description' => t('This is a demonstration field coded to fail validation for single character values.'),
'#default_value' => $pane_values['name'],
'#required' => TRUE,
);

return $form;
}

Please see the image to understand what I want to do:

https://dl.dropboxusercontent.com/u/109058380/Payment.jpg

- jakaria on September 25, 2013
Vote up!
0
Vote down!

Dear Ajai,

I want to add field to Payment (Example payment Module), How I duplicate below code (line #36 of commerce_payment_example.module), to show 3 different field :

// Merge in default values.
$pane_values += array(
'name' => '',
);

$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#description' => t('This is a demonstration field coded to fail validation for single character values.'),
'#default_value' => $pane_values['name'],
'#required' => TRUE,
);

return $form;
}

Please see the image to understand what I want to do:

https://dl.dropboxusercontent.com/u/109058380/Payment.jpg

Answer by: jakaria
Posted: Sep 25, 2013