Not even sure where to begin with this one. Updated Magento from 2.2 to 2.3, and now when you go to a product page, only the image loads. There's nothing in the body but that and some javascript, then an error:

Uncaught Error: Call to a member function getOptionsJson() on null in /home/vagrant/code/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml:46

Which is pointing at "options": <?= /* @noEscape */ $block->getGalleryOptions()->getOptionsJson() ?>, but I have absolutely no idea what getGalleryOptions is doing or why it would be null.


This was raised as an issue on the Magento github and is caused by an incompatibility with custom code in your theme. you will find more info and a solution here

You need to locate in whichever of your third party modules is instantiating an instance of the "\Magento\Catalog\Block\Product\View\Gallery" class in its layout xml files and ensure it is injecting the argument "gallery_options" to the block

| 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.