Currently commerce outputs HTML using ['#prefix'] and ['#suffix']. Here are two examples:

CartBlock.php:

$cart_views[] = [
  '#prefix' => '<div class="cart cart-block">',
  '#suffix' => '</div>',
  '#type' => 'view',
  '#name' => $available_views[$cart_id],
  '#arguments' => [$cart_id],
  '#embed' => TRUE,
];

CartController.php:

$build[$cart_id] = [
  '#prefix' => '<div class="cart cart-form">',
  '#suffix' => '</div>',
  '#type' => 'view',
  '#name' => $cart_views[$cart_id],
  '#arguments' => [$cart_id],
  '#embed' => TRUE,
];

As a themer it is hard to get rid of that since there is not template to override and remove the markup. We should introduce twig templates in those cases.

Comments

Lukas von Blarer created an issue. See original summary.

bojanz’s picture

Status: Active » Closed (duplicate)