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
Comment #2
bojanz commentedDuplicate of #2876969: Move all markup into Twig files.