You are here

function theme_commerce_product_bundle_attribute in Commerce Product Bundle 7

Same name and namespace in other branches
  1. 7.2 commerce_product_bundle.module \theme_commerce_product_bundle_attribute()

Themes the attributes of the bundle products.

Parameters

array $variables: Array of variables passed to the function.

Return value

array Themed markup for displaying the attributes.

See also

commerce_product_bundle_theme().

1 theme call to theme_commerce_product_bundle_attribute()
commerce_product_bundle_attribute_field in ./commerce_product_bundle.module
Implements hook_attribute_field().

File

./commerce_product_bundle.module, line 1436
Allows the bundling of products in Drupal Commerce.

Code

function theme_commerce_product_bundle_attribute($variables) {
  $sub_line_item = $variables['sub_line_item'];
  $product_attribute_view = $variables['product_attribute_view'];
  if (!empty($product_attribute_view)) {
    $product_attribute_view = '<div class="commerce-product-bundle-product-attributes">' . $product_attribute_view . '</div>';
  }
  $output = '<div class="commerce-product-bundle-sub-line-item"><div class="commerce-product-bundle-sub-line-item-title">';
  $output .= '<span class="commerce-product-bundle-quantity">' . (double) $sub_line_item->quantity . '</span>';
  $output .= ' x ';
  $output .= '<span class="commerce-product-bundle-title">' . commerce_line_item_title($sub_line_item) . '</span></div>';
  $output .= $product_attribute_view;
  $output .= '</div>';
  return $output;
}