Search code examples
magento-1.5magento

Problem with custom registration fields in an multistore setup in magento


I have 2 sites running on my magento platform.

For site2, I added new fields to the registration page and it works properly.

Now, I noticed that when I try to register in site1, on submit I am shown a validation message that the additional fields I have added for site2 are required.

How do I make sure that the additional fields added for site2, are asked only for site2 and not site1?

I have separate themes for both site1 and site2 and both of them have separate register.phtml files.

In the config.xml file for adding custom registration fields, I have this added:

<customer_account>
    <employee_id>
        <create>1</create>
        <update>1</update>
    </employee_id>
    <doj>
        <create>1</create>
        <update>1</update>
    </doj>
    <mobile_number>
        <create>1</create>
        <update>1</update>
    </mobile_number>
    <alternate_mail>
        <create>1</create>
        <update>1</update>
    </alternate_mail>
</customer_account>

which is under <global> tag. I assume Magento is reading this. How do I make sure magento reads this config file for a particular site/store? Thanks.


Solution

  • If you want to see the entire XML tree magento has compiled from all XML configuration files:

    header("Content-Type: text/xml");
    die(Mage::app()->getConfig()->getNode()->asXML());
    

    Will present you with a single compiled XML of their entire tree, this may help in determining if your changes are being added.

    Also be sure and checkout Alan Storms CommerceBug as it has this functionality built-in.