Is there an easy way to add an address at the time of registration? I have added some custom fields and in the process I found that in “register.phtml” there is a section containing the address fields but conditional on this statement:
<?php if($this->getShowAddressFields()): ?>
Is there a setting in the admin panel or elsewhere that would open these up?
In order for us to validate our wholesale customers we need to collect this data at registration so that we can allow them “Wholesale Access” to the site.
Also, What file could I insert some script that would capture the form values at the time of saving the info.. I would like to insert some triggers to run some custom scripts..
Also looking for the same. I have searched the DB fields and the admin area looking for this.
I am about to follow this post: http://www.magentocommerce.com/boards/viewthread/9620/ to achieve what I wanted but prefer to work within magento rather than hack away at it.
I’m interested in it too.
How can I add address information during account registration?
I want people to insert their address in order to have alway this information, not only for people who proceed to order.
If I insert custom field when they place an order they will insert a new address.
As of 1.3.2.1, commenting out the ‘if’ and ‘endif’ seems to be incomplete by itself, as the ‘state/province’ field them disappears.
A proper fix is posted here:
http://www.magentocommerce.com/boards/viewthread/43354/
in the “register.phtml” delete or comment out the line:
<?php if($this->getShowAddressFields()): ?>
and also <?php endif; ?>
then go to .....template/customer/address/edit.phtml
and copy the javascript snippet at the end of the file, because it changed, or use this and overwrite the script at the end of register.phtml
New script from edit.phtml:
<script type="text/javascript\">
var dataForm = new VarienForm(’form-validate’, true);
new RegionUpdater(’country’, ‘region’, ‘region_id’, <?php echo $this->helper('directory')->getRegionJson() ?>);
</script>
No need to add any javascript, there is no bug on this page.
Just don’t forget to remove or comment line 148 and 150 (<?php if(!$this->getShowAddressFields()): ?>)
in the “register.phtml” delete or comment out the line:
<?php if($this->getShowAddressFields()): ?>
and also <?php endif; ?>
then go to .....template/customer/address/edit.phtml
and copy the javascript snippet at the end of the file, because it changed, or use this and overwrite the script at the end of register.phtml
New script from edit.phtml:
<script type="text/javascript\">
var dataForm = new VarienForm(’form-validate’, true);
new RegionUpdater(’country’, ‘region’, ‘region_id’, <?php echo $this->helper('directory')->getRegionJson() ?>);
</script>
No need to add any javascript, there is no bug on this page.
Just don’t forget to remove or comment line 148 and 150 (<?php if(!$this->getShowAddressFields()): ?>)
Right you are. I needed this fix again, so I figured I’d throw in a bit more detail.
Yes, but you will need to create new design and skin folders and point them to the correct store. Since your Default configuration points to only one app/design and skin/ set of folders (mainly default/), you’ll have to make a different set of folders in the app/frontend/default/[new-folder] and skin/frontend/default/[new-folder]. Then in the System-Configuration, make sure you have the right website selected, then change the folders in the [Wholesale]-System-Configuration-Design. hope this helps!
I think the easiest way to add new fields to the registration form is to install Customer Attributes extension. It gives the ability to easily add any fields you like, show them in admin area, allows to filter by them. Compatible with both 1.3 and 1.4 versions.
Please feel free to pm me if you have any questions regarding the addon.
There’s also another way to fix this. Mage_Checkout_MultishippingController::registerAction (v1.4.0.1) contains the following code:
if ($registerForm = $this->getLayout()->getBlock('customer_form_register')) { $registerForm->setShowAddressFields(true) ->setBackUrl($this->_getHelper()->getMSLoginUrl()) ->setSuccessUrl($this->_getHelper()->getMSShippingAddressSavedUrl()) ->setErrorUrl($this->_getHelper()->getCurrentUrl()); }
It looks like getShowAddressFields and setShowAddressFields are a magic getter and setter. So the logical choice would be to put part of this code in Mage_Customer_AccountController::createAction…
WRONG!
Magento gives developers the ability to extend modules. This is just a class-loader trick. The class-loader first checks app/code/local, then app/code/core. (See how_to_create_a_local_copy_of_app_code_core_mage.) A more acurate description would be “overloading”.
Only problem: you can’t overload controllers. Best solution: overload the block called “customer_form_register”.