function uc_product_get_description in Ubercart 8.4
Same name and namespace in other branches
- 6.2 uc_product/uc_product.module \uc_product_get_description()
- 7.3 uc_product/uc_product.module \uc_product_get_description()
Returns HTML for the product description.
Modules adding information use hook_uc_product_description() and modules wanting to alter the output before rendering can do so by implementing hook_uc_product_description_alter(). By default, all descriptions supplied by modules via hook_uc_product_description() are concatenated together.
Parameters
$product: Product.
Return value
string HTML rendered product description.
6 calls to uc_product_get_description()
- hook_uc_cart_display in uc_cart/
uc_cart.api.php - Controls the display of an item in the cart.
- OrderProductViewBuilder::buildContent in uc_order/
src/ OrderProductViewBuilder.php - Products::view in uc_order/
src/ Plugin/ Ubercart/ OrderPane/ Products.php - Returns the contents of an order pane as a store administrator.
- theme_uc_cart_review_table in uc_cart/
uc_cart.theme.inc - Formats the cart contents table on the checkout page.
- uc_product_kit_uc_cart_display in uc_product_kit/
uc_product_kit.module - Implements hook_uc_cart_display().
File
- uc_product/
uc_product.module, line 841 - The product module for Ubercart.
Code
function uc_product_get_description($product) {
// Run through implementations of hook_uc_product_description().
$description = \Drupal::moduleHandler()
->invokeAll('uc_product_description', [
$product,
]);
// Now allow alterations via hook_uc_product_description_alter().
\Drupal::moduleHandler()
->alter('uc_product_description', $description, $product);
return drupal_render($description);
}