Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:31:16+00:00 2026-06-16T01:31:16+00:00

I have added a custom attribute to customer address(to select address type commercial or

  • 0

I have added a custom attribute to customer address(to select address type commercial or residential) using Hwg Attribute manager extension(Manage Category, Customer and Customer Address Attributes). It is working in the back end. But the problem is not working for the front end. So i have added this code to
app/design/frontend/base/default/template/customer/address/edit.phtml

<li class="fields">         
                <label for="billing:addresstype" class="required"><em>*</em><?php echo $this->__('Address Type') ?></label>
                <div class="input-box"> 
                    <select name="billingaddresstype" id="billingaddresstype">
                        <?php $collection = Mage::getResourceModel('eav/entity_attribute_option_collection');                           
                            $collection->setAttributeFilter(174);
                            $collection->setStoreFilter();
                            $collection->load();
                            $options = $collection->toOptionArray();
                            foreach ($options as $option) {
                                echo "<option value='".$option['value']."'>".$option['label']."</option>";             
                             }
                        ?>
                    </select><?php  //var_dump($options); ?>
                </div>
            </li>

Now the combo box is appear in the front end. But it doesn’t save data. Then i check the submitting form values in the AddressController

 $addressForm = Mage::getModel('customer/form');
        $addressForm->setFormCode('customer_address_edit')
            ->setEntity($address);
        $addressData    = $addressForm->extractData($this->getRequest());

        var_dump($addressData);

        break;

It doesn’t contain my custom attribute values.

array(11) { ["firstname"]=> string(8) "thushara" 
        ["lastname"]=> string(11) "Mannaperuma"
        ["company"]=> string(3) "flt"
        ["street"]=> array(2) 
            { [0]=> string(17) "1234 Heartwood Dr"   [1]=> string(0) "" } 
            ["city"]=> string(10) "Beltsville" 
            ["country_id"]=> string(2) "US" 
            ["region"]=> string(0) "" 
            ["region_id"]=> string(2) "31" 
            ["postcode"]=> string(5) "20705" 
            ["telephone"]=> string(12) "548-789-6548" 
            ["fax"]=> string(0) "" } 

I’ stuck at this point.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:31:18+00:00Added an answer on June 16, 2026 at 1:31 am

    I worked it out.

    Make sure you have the latest version of the Hwg Attribute manager extension.

    you can use this link direct-download-magento-extension to get the extension as a zip file.

    This is the code i used to get my custom attribute to the frontend. and it is saving data correctly.

    <li class="fields">
                    <?php 
                        $attribute = Mage::getModel('eav/config')->getAttribute('customer_address','adtype');
                    ?>
                    <label for="adtype" class="<?php if($attribute->getIsRequired() == true){?>required<?php } ?>"><?php if($attribute->getIsRequired() == true){?><em>*</em><?php } ?><?php echo $this->__('Address Type') ?></label>
                    <div class="input-box">
                        <select name="adtype" id="adtype" class="<?php if($attribute->getIsRequired() == true){?>required-entry<?php } ?>">
                            <?php
                                 $options = $attribute->getSource()->getAllOptions();                                
                                 foreach($options as $option){
                            ?>
                                <option value='<?php echo $option['value']?>' <?php if($this->getCustomer()->getAdtype() == $option['value']){ echo 'selected="selected"';}?>><?php echo $this->__($option['label'])?></option>
                            <?php } ?>
                        </select>
                    </div>
                </li> 
    

    adtype is my attribute code. field name and id must be the attribute code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use a custom extension for my ActionLinks. I have added an attribute data_url
I have added custom attribute with the code my_price with Catalog Input Type for
I have assigned a custom data attribute to some circles added to the Raphael
I have added a custom action to the CustomList type. For testing purposes I
I am using jquery validation plugin for form validation. I have added a custom
I have added a custom page to my installer created using nsDialogs, however, the
I have added a custom category attribute to my Magento installation with the following
I have defined a custom attribute and added it to a few classes. Know
I have created a custom attribute 'RoleAction' and added to the model property public
I have created a new attribute ‘county’ in customer address. It is working fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.