Guest User

Untitled

a guest
Oct 23rd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. function THEME_commerce_price_formatted_components($variables) {
  2. // Add the CSS styling to the table.
  3. drupal_add_css(drupal_get_path('module', 'commerce_price') . '/theme/commerce_price.theme.css');
  4.  
  5. // Build table rows out of the components.
  6. $rows = array();
  7.  
  8. foreach ($variables['components'] as $name => $component) {
  9. $rows[] = array(
  10. 'data' => array(
  11. array(
  12. 'data' => $component['title'],
  13. 'class' => array('component-title'),
  14. ),
  15. array(
  16. 'data' => $component['formatted_price'],
  17. 'class' => array('component-total'),
  18. ),
  19. ),
  20. 'class' => array(drupal_html_class('component-type-' . $name)),
  21. );
  22. }
  23.  
  24. $rows = array_splice($rows, 2);
  25.  
  26. return theme('table', array('rows' => $rows, 'attributes' => array('class' => array('commerce-price-formatted-components'))));
  27. }
Add Comment
Please, Sign In to add comment