I would like to add helper texts to the different options in the payment methods form, in Drupal Commerce, like this:

/Radio button/ Payment method 1

Helper text option 1...

/Radio button/ Payment method 2

Helper text option 2....

This is what one of the payment method options looks like in code:

* Implements hook_commerce_payment_method_info().
function swish_payments_commerce_payment_method_info() {
  $payment_method = array();

  $payment_method['payment_method_1'] = array(
    'base' => 'payment_method_1',
    'weight' => 20,
    'title' => t('Payed for with mobile pay'),
    'display_title' => t('Pay with mobile pay'),
    'description' => t('Choose this option if.....'),
    'active' => TRUE,
    'offsite' => FALSE,
    'offsite_autoredirect' => FALSE,

  return $payment_method;

The content of the description field doesn't show anywhere in the specific payment method (in the Settings pane at the bottom of the page admin/commerce/config/payment-methods/manage/xx).

So how can I add helper texts to the options under each payment method in the form?

  • The table of *Store->Config->Payment methods * build by this commerce_payment_ui_admin_page function they didn't add description to markup take a look at this api.drupalhelp.net/api/commerce/… – berramou Oct 30 at 17:08
  • So you can override the page callback here api.drupalhelp.net/api/commerce/… and add it yourself in custom module . – berramou Oct 30 at 17:12
  • It turns out I wrote the wrong path in my question. The payment method title can be seen under Settings on the bottom of the page admin/commerce/config/payment-methods/manage/xx, but not the description. – TBJ Oct 31 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.