It would be great to be able to show credit card icons for the accepted cards, similar to the way it's displayed in uc_credit.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnodonnell@mac.com’s picture

+1

johnodonnell@mac.com’s picture

I was able to add some markup to the form by using hook_form_alter()

function MYMODULE_form_alter(&$form, &$form_state, $form_id) {
    if (strpos($form_id, 'commerce_checkout_form_review') === 0) {
        $form['commerce_payment']['payment_details']['#prefix'] .= "<p>This markup appears below select payment.</p>";
    }
}

It would be nicer if the pane had an option to add some markup.

michelle.ichinco’s picture

Agreed.

michelle.ichinco’s picture

I added credit card icons this way, where you have to change $payment_methods to include the credit cards you want to display.

rickmanelius’s picture

Priority: Normal » Minor
Status: Active » Needs review
FileSize
1.61 KB

This sounds cool! But you'd also have to supply the icons along with the patch.

At a glance, this doesn't look too hairy. First step is a re-roll of the current patch as it doesn't apply properly. I'll add this for now as a placeholder.

rszrama’s picture

Priority: Minor » Normal
Status: Needs review » Needs work

I'm torn. We do this in PayPal, but we use the theme function to generate the HTML for images. However, this causes problems when entity_get_info() is called before the theme is initialized.

Regardless, now that we have a card types checkboxes setting in the payment method, we should base the visible icons on that.

spazfox’s picture

Another solution is to simply use the String Overrides module to replace "Credit card" with "Credit card + <img> tags to the icons" etc.