I have defined customer attributes for my customers, and have not had a problem calling upon those attributes until today. I have a custom text attribute for an outside account number. I can see it on the admin backend and edit it, works fine. However, when I try to call it on the front end it fails, while other attributes I set up the exact same way work fine. I have two attributes, outside_account (text/string), and on_terms (true/false boolean).
In order to get the values of these attributes on the frontend, I wrote a couple methods based on a guide I found. In /app/code/core/Mage/Checkout/Model/Type/Abstract.php I defined the methods:
public function getOnTerms()
{
$onTerms = $this->getData('on_terms');
if(is_null($onTerms){
$onTerms = FALSE;
}
}
public function getOutsideAccount()
{
return $this->getData('outside_account');
}
Then two more methods in /app/code/core/Mage/Customer/Helper/Data.php:
public function getCustomerOnTerms()
{
$onTerms = $this->getCustomer()->getOnTerms();
if(is_null($onTerms)){
$onTerms = FALSE;
}
return $onTerms;
}
public function getCustomerOutsideAccount()
{
return $this->getCustomer()->getOutsideAccount();
}
Now when I call Mage::helper('customer')->getCustomerOnTerms()
it works fine and I get the value of on_terms. However, when I call Mage::helper('customer')->getCustomerOutsideAccount()
it fails and returns a null, even when values are entered for the customer.
I'm not sure if there is additional code I need to add because its a string instead of a boolean, but I've tried lots of things and have been unsuccessful each time. Any assistance would be wonderful! Thank you! And I know a lot of the code is ugly I will clean it up more once I have it all working properly!