3 replies [Last post]
Toby's picture
Offline
Joined: 04/09/2008
Juice: 58
Was this information Helpful?

Hi all,

We have a small problem and hope someone can come to the rescue! We have a new site about to be launched but there is a minor problem that we need to overcome.

When you go to checkout we have two payment options, paypal and credit card.

Both of these options do not display the correct cards, they are more based to an American market. Here is a current screenshot of the cards it displays:

http://img.photobucket.com/albums/v613/tobya/Toy%20Tuning%20Watermarked%...

As we are in the UK we need to also display Maestro, Switch, Solo, JCB and Laser, both for the paypal part and the credit card. We also need to edit the credit card text so that it displays "Credit/Debit Card", not just credit card.

Currently if a customer comes onto our new site they will not see that their card is displayed meaning it's doubtful they will make the purchase, seeing as most users will have a Switch, Maestro or Solo. I know for a fact that if I find a site and they don't display my card I won't "just try it", I will take it that they don't accept it and move on.

Is their any way we can change these displayed icons as well as editing the text part?

If someone could kindly let us know we would appreciate it, we have asked our web developer to look into if for us but I don't think he has and we are supposed to go live today.

Best Regards,

Toby

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 850
hook_form_alter() is your

hook_form_alter() is your friend. In this case, you'll want to do something like....

<?php
function your_module_form_alter() {
  if(
$form_id == 'uc_cart_checkout_form' && isset($form['panes']['payment']['payment_method']['#options']['credit'])){
   
$form['panes']['payment']['payment_method']['#options']['credit'] = 'Credit/Debit Card ';
   
$form['panes']['payment']['payment_method']['#options']['credit'] .= '<img src="/myCart/sites/all/modules/ubercart/payment/uc_credit/images/your_maestro_image.gif" style="position: relative; top: 5px;">';
   
$form['panes']['payment']['payment_method']['#options']['credit'] .= '<img src="/myCart/sites/all/modules/ubercart/payment/uc_credit/images/your_switch_image.gif" style="position: relative; top: 5px;">';
 
// Add your other 3 images in the same way
 
}
}
?>

That will give you the images you want for credit card and you can apply the same logic to paypal.

Toby's picture
Offline
Joined: 04/09/2008
Juice: 58
Re: hook_form_alter() is your

Thank you kindly really appreciate the help, our web developer has seen the message and should be clear on what to do. He thinks their should be a theme function for it but for now the above should do the trick, I will let you know how we get on.

All the best,

Toby

pixel8's picture
Offline
Joined: 01/14/2010
Juice: 30
Re: hook_form_alter() is your

Does this work for the latest version? I'm using Ubercart 6.x-2.4 and have copied the code above into my template file and have changed your_module_form_alter to reviber_form_alter (the name of the theme is reviber) and nothing appears to be different even after clearing the cache.

Drupal Developer with Manchester Gig Promotions on the side and an Ubercart shop where you can buy sexy lingerie