I'm overriding the file Magento_Checkout/templates/cart/form.phtml, I stumbled upon some php code generating html code which I can't find its origin
Here is the code
<?php foreach ($block->getItems() as $_item) :?>
 <?= $block->getItemHtml($_item) ?>
<?php endforeach ?>
So my goal is to change the html output of the function getItemHtml, the block handling the template is @var $block \Magento\Checkout\Block\Cart\Grid
I don't understand how does it works, I guess it's not hard coded and we can change a layout which handle this?
Thanks for reading
1 Answer 1
Are you just looking for the file which holds the HTML for each item rendered in that foreach list?
You can find that here:
vendor/magento/module-checkout/view/frontend/templates/cart/item/default.phtml
You can create a version of this in your theme for your custom HTML here:
Magento_Checkout/templates/cart/item/default.phtml
- 
 Thanks, it was what I was looking for, what was your process finding it?ChristopheS– ChristopheS2020年05月19日 08:44:42 +00:00Commented May 19, 2020 at 8:44
- 
 For speed when developing themes I install this: mgt-commerce.com/documentation/magento2-mgt-developer-toolbar This show all the blocks along with the paths to the HTML files usedReadio– Readio2020年05月19日 08:56:51 +00:00Commented May 19, 2020 at 8:56