You are here

function commerce_paypal_icons in Commerce PayPal 7

Same name and namespace in other branches
  1. 7.2 commerce_paypal.module \commerce_paypal_icons()

Returns an array of PayPal payment method icon img elements.

Return value

The array of themed payment method icons keyed by name: visa, mastercard, amex, discover, echeck, paypal

1 call to commerce_paypal_icons()
commerce_paypal_wps_commerce_payment_method_info in modules/wps/commerce_paypal_wps.module
Implements hook_commerce_payment_method_info().

File

./commerce_paypal.module, line 383
Implements PayPal payment services for use with Drupal Commerce.

Code

function commerce_paypal_icons() {
  $icons = array();
  $payment_methods = array(
    'visa' => t('Visa'),
    'mastercard' => t('Mastercard'),
    'amex' => t('American Express'),
    'discover' => t('Discover'),
    'echeck' => t('eCheck'),
    'paypal' => t('PayPal'),
  );
  foreach ($payment_methods as $name => $title) {
    $variables = array(
      'path' => drupal_get_path('module', 'commerce_paypal') . '/images/' . $name . '.gif',
      'title' => $title,
      'alt' => $title,
      'attributes' => array(
        'class' => array(
          'commerce-paypal-icon',
        ),
      ),
    );
    $icons[$name] = theme('image', $variables);
  }
  return $icons;
}