Namespace/Modulename/Block/donation.php
namespace Namespace\Modulename\Block;
class Productpoint extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
array $data = []
) {
parent::__construct($context, $data);
}
}
Namespace/Modulename/view/frontend/web/templates/checkout/cart/donation.phtml
<span><?php echo 'Eureka'; ?></span>
Rewrite checkout_cart_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Namespace\Modulename\Block\Productpoint" before="-" template="Namespace_Modulename::checkout/cart/productpoint.phtml"/>
</referenceContainer>
</body>
</page>
The block is not loading on cart page. How do I call my custom block on cart page?