Namespacee/Modulename/Block/Productpoint.php
<?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/layout/checkout_cart_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<body>
<referenceContainer name="content">
<block template="checkout/cart/productpoint.phtml" class="Namespace\Modulename\Block\Productpoint" name="productpoints.cart.block" as="productpointblock" before="-"/>
</referenceContainer>
</body>
</page>
Namespace/Modulename/view/frontend/templates/checkout/cart/productpoint.phtml
<span><?php echo 'Eureka'; ?></span>
The block is not loading on cart page. How do I call my custom block on cart page ?