Tags/topics: 
2
Answers
Vote up!
0
Vote down!

Payment Options Name Change

Hi

I'm running an off site payment gateway (Payfast) on my commerce site. The gateway can handle credit cards, instant EFT and uKash, so I've decided to list them separate each with their own max min quantity rules. The problem is, now there is 3 payment options, but it is listed with the same name: Payfast, Payfast & Payfast, instead of Credit Card Payment, EFT Payment & uKash payment.

How/where can I change the display name of these payment options?

Help would be much appreciated!

Renier

Asked by: Renier
on August 8, 2013

2 Answers

Vote up!
2
Vote down!

This can be done in the template.php of your theme. Below is a video and a code snippet that I used to demonstrate how to make this happen.

<?php
function YOURTHEME_form_alter(&$form, &$form_state, $form_id) {
 
//dpm($form_id);
 
if ($form_id == "commerce_checkout_form_review") {
   
//dpm($form);
   
foreach ($form['commerce_payment']['payment_method']['#options'] as $id => $title) {
     
//dpm($id);
     
if (stristr($id, "payment_example")) {
       
$form['commerce_payment']['payment_method']['#options'][$id] = "Blue and Awesome";
      }
      if (
stristr($id, "payment_2")) {
       
$form['commerce_payment']['payment_method']['#options'][$id] = "This is a cool thing";
      }
      if (
stristr($id, "payment_3")) {
       
$form['commerce_payment']['payment_method']['#options'][$id] = "WOW";
      }
    }
  }
}
?>
Josh Miller
Answer by: Josh Miller
Posted: Aug 8, 2013

Comments

WOW, you're not only Cool, but Blue and Awesome too. ; )
Thanks so much

- Renier on August 9, 2013