I got this error:
Fatal error: Call to a member function getPrice() on null in /home/.../public_html/vendor/magento/module-checkout/Block/Shipping/Price.php on line 71
So, after reading this solution here I altered this file:
/app/design/frontend/Package/Theme/Magento_Checkout/Block/Shipping/Price.php
However, I still keep getting the same error:
Fatal error: Call to a member function getPrice() on null in /home/.../public_html/vendor/magento/module-checkout/Block/Shipping/Price.php on line 71
Which makes me think that Magento2 is ignoring my Block
in Magento_Checkout
, and defaulting back to Magento2's own core code.
How can I solve this issue (without editing the core code).
Is there something I need to do to register this Block?
Before I get asked:
I have deployed:
php bin/magento setup:static-content:deploy
I have re-indexed:
php bin/magento indexer:reindex
I have cleared the cache:
php bin/magento cache:clean
php bin/magento cache:flush
And Magento 2 is in the painfully slow developer mode.
I have made alterations to the view files in /app/design/frontend/Package/Theme/Magento_Checkout/view/frontend/templates/...
and these have all worked fine. They are not being ignored, only /app/design/frontend/Package/Theme/Magento_Checkout/Block
is being ignored.
I think my problem here might be related, I have made changes to XML Layout for Magento_CatalogSearch
but these changes are being ignored, and the default XML Layout is being used instead.