Révision e9f59589
Ajouté par Assos Assos il y a presque 10 ans
drupal7/sites/all/modules/commerce_price_flexyformatter/commerce_price_flexyformatter.module | ||
---|---|---|
350 | 350 |
drupal_add_css(drupal_get_path('module', 'commerce_price_flexyformatter') . '/commerce_price_flexyformatter.css'); |
351 | 351 |
foreach ($variables as $key => $variable) { |
352 | 352 |
if (isset($variable['weight']) && is_numeric($variable['weight']) && ($key == 'base' || $variable['enabled'])) { |
353 |
$output .= '<span class=flexy-item' . ($variable['class']?' ' . $variable['class']:'') . '><span class"flexy-title">' . $variable['label'] . '</span><span class="flexy-amount">' . ($variables['raw'] == false ? commerce_currency_format($variable['amount'], $variables['currency_code']): commerce_currency_amount_to_decimal($variable['amount'], $variables['currency_code'])) . '</span></span> ';
|
|
353 |
$output .= '<span class=flexy-item' . ($variable['class']?' ' . $variable['class']:'') . '><span class"flexy-title">' . $variable['label'] . '</span><span class="flexy-amount">' . ($variables['raw'] == false ? commerce_currency_format($variable['amount'], $variables['currency_code']): commerce_price_flexyformatter_raw_format($variable['amount'], $variables['currency_code'])) . '</span></span>';
|
|
354 | 354 |
} |
355 | 355 |
} |
356 | 356 |
|
357 | 357 |
return $output; |
358 | 358 |
} |
359 |
/** |
|
360 |
* Calculate raw |
|
361 |
*/ |
|
362 |
function commerce_price_flexyformatter_raw_format($amount, $currency_code){ |
|
363 |
$currency = commerce_currency_load($currency_code); |
|
364 |
$amount = commerce_currency_amount_to_decimal($amount, $currency_code); |
|
365 |
return number_format($amount, $currency['decimals'], $currency['decimal_separator'], ''); |
|
366 |
} |
|
359 | 367 |
/** |
360 | 368 |
* Calculate amount to be displayed. |
361 | 369 |
* |
Formats disponibles : Unified diff
Weekly update of contrib modules