You are here

function _webform_table_product_grid in Ubercart Webform Integration 6

Same name and namespace in other branches
  1. 7.3 components/product_grid.inc \_webform_table_product_grid()
  2. 7.2 components/product_grid.inc \_webform_table_product_grid()

Implementation of _webform_table_component().

File

components/product_grid.inc, line 298
Webform module product grid component.

Code

function _webform_table_product_grid($component, $value) {
  $output = '';

  // Set the value as a single string.
  if (is_array($value)) {
    foreach ($value as $key => $val) {
      $nid_sku = explode('_', $key, 2);
      $aid_oid = explode('_', $val, 2);
      $node = node_load($nid_sku[0]);

      // Output the SKU and the option.
      $output .= check_plain($node->model) . ' - ' . check_plain($node->attributes[$aid_oid[0]]->options[$aid_oid[1]]->name) . '<br />';
    }
  }
  return $output;
}