You are here

commerce-order-item.html.twig in Commerce Core 8.2

Default template for commerce order items.

Available variables:

  • attributes: HTML attributes for the wrapper.
  • order_item: The rendered oreder item fields. Use 'order_item' to print them all, or print a subset such as 'order_item.title'. Use the following code to exclude the printing of a given field:

  {{ order_item|without('title') }}
  
  • commerce_order_item_entity: The order item entity.

To get some value from product use {{ order_item_entity.getPurchasedEntity.getProduct.something }}.

File

modules/order/templates/commerce-order-item.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. *
  5. * Default template for commerce order items.
  6. *
  7. * Available variables:
  8. * - attributes: HTML attributes for the wrapper.
  9. * - order_item: The rendered oreder item fields.
  10. * Use 'order_item' to print them all, or print a subset such as
  11. * 'order_item.title'. Use the following code to exclude the
  12. * printing of a given field:
  13. * @code
  14. * {{ order_item|without('title') }}
  15. * @endcode
  16. * - commerce_order_item_entity: The order item entity.
  17. *
  18. * To get some value from product use {{ order_item_entity.getPurchasedEntity.getProduct.something }}.
  19. *
  20. * @ingroup themeable
  21. */
  22. #}
  23. <div{{ attributes }}>
  24. {{- order_item -}}
  25. </div>