I got following error in Magento 2.1.8 in my custom theme e.g. mytheme.

Exception #0 (Exception): Notice: Undefined variable: imageBlockBuilder in /home/public_html/app/design/frontend/Company/mytheme/Magento_Catalog/templates/product/list/items.phtml on line 220


As imageBlockBuilder is no longer used in Magento 2.1.8
To fix above error do following:

$productImage = $imageBlockBuilder->buildBlock($_product, $imageDisplayArea);


$productImage = $block->getImage($_product, $imageDisplayArea);

Here $imageDisplayArea may be different variable in your case, change it as per your need.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.