function _webform_display_product in Ubercart Webform Integration 7.3
Same name and namespace in other branches
- 6 components/product.inc \_webform_display_product()
- 7.2 components/product.inc \_webform_display_product()
Implements _webform_display_component().
File
- components/
product.inc, line 225 - Webform module product component.
Code
function _webform_display_product($component, $value, $format = 'html') {
$product_info = explode('_', $component['extra']['product'], 2);
$node = node_load($product_info[0]);
$result_info = array(
t('Title: @title<br/>SKU: @sku<br/>Quantity: @quantity', array(
'@title' => $node->title,
'@sku' => $product_info[1],
'@quantity' => $value[0],
)),
);
$element = array(
'#title' => check_plain($component['name']),
'#weight' => $component['weight'],
'#theme' => 'uc_webform_display_product',
'#theme_wrappers' => $format == 'html' ? array(
'webform_element',
) : array(
'webform_element_text',
),
'#post_render' => array(
'webform_element_wrapper',
),
'#component' => $component,
'#format' => $format,
'#value' => $result_info,
);
return $element;
}