2

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

1 Answer 1

6

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

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

with

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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