I'm trying to extend Magento\Customer\Block\Account\Dashboard\Info.php
file. I created a module, where I have my custom block, Info.php
. I want to display the telephone number of the customer after.
<?php
namespace Portail\Customer\Block\Account\Dashboard;
class Info extends Magento\Customer\Block\Account\Dashboard\Info
{
public function testTxt(){
return 'bonjour';
}
}
I have added a di.xml
in etc/
<?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\Customer\Block\Account\Dashboard\Info" type="Portail\Customer\Block\Account\Dashboard\Info" />
</config>
But I have this error : Method invalid Magento\Customer\Block\Account\Dashboard\Info::testTxt