How do i display the telephonenumber on customer dashboard?
I have extended the original class to add some functions, but I can't find the right way to show customer number. I read that telephonenumber that is related to the address.
This is my class:
<?php
namespace Portail\Customer\Block;
use Magento\Customer\Model\Session;
class Info extends \Magento\Customer\Block\Account\Dashboard\Info
{
public function testTxt(){
return 'bonjour';
}
public function getTelephoneCustomer(){
$customerData = $this->getCustomer();
$telephone = $customerData->getDefaultShippingAddress()->getTelephone();
return $telephone;
}
}
When I tried to reload my page, the loading is just stop, there no error.

Magento_Customer::account/dashboard/info.phtml– Condor Jun 25 '18 at 10:33