Magento: How to display customer's phone number on customer information field

后端 未结 5 908
旧时难觅i
旧时难觅i 2021-01-03 05:52

I’m trying to have the customer’s phone number show under the customer account information section. I know the phone number belongs to the customer address section but I’m t

5条回答
  •  鱼传尺愫
    2021-01-03 06:17

    Luis has mentioned before that if customer didn't setup his billing address you will get an error in return: Call to a member function in a non-object.

    If you want to be ready for such situation you can put the code into following IF statement:

    
        load($customerAddressId); ?>
        getCustomer()->getPrimaryBillingAddress()->getTelephone(); 
    } ?>
    

提交回复
热议问题