I'm trying to customize a Magento 2.1 cart page both by overriding the Block Cart and accessing some of the overridden elements in a new phtml template.
I hit a roadblock after overriding the Cart block however, as it appears the overridden block in never loading any cart form.phtml, custom or otherwise.
I have created the override by creating the app/code/Vendor/Module/Block/Cart.php file that extends \Magento\Checkout\Block\Cart
<?php
namespace Vendor\Module\Block;
use Magento\Framework\View\Element\Template;
class Cart extends \Magento\Checkout\Block\Cart {
public function getContinueShoppingUrl() {
return 'http://externalurl/from/config';
}
}
I have also created app/code/Vendor/Module/etc/di.xml with the configuration
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Checkout\Block\Cart" type="Vendor\Module\Block\Cart" />
</config>
I know that the overridden block is at least loading, as I can get output from echoing items in the constructor and there appear to be no other errors in the log. However, when I go to the /checkout/cart/ page, where I expect the checkout details to load I get nothing - just the typical header and footer elements surrounding a blank page.
Any idea what I'm missing here?