Magento – Create account – Indicate company

Picture

The one and the other might want to, that in the registration of new customers in addition to the tax ID, the company name is specified, what is actually obvious.

Magento itself is here no standard way “View company” be deposited with the registry Yes or No, as e.g.. is possible to control number.

To make display but the field is now in the user registry, register.phtml you open the file in the directory app / design / frontend /[base or default]/[IhrTemplate]/template / customer / form and studied there for the lines responsible for the company's query. For me this was e.g.. Line 76 bus 79

                    <div class ="input-box">
                        <label for="company"><?php echo $this->__('Company') ?></label><br />
                        <input type="text" name ="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class ="input-text" />
                    </div>

These lines are then moved to the desired location. I wanted to have the company name on the email address and they have therefore in line 49 ago

                    <div class ="input-box">
                        <label for="email_address"><?php echo $this->__('Email Address') ?> <span class="required">*</span></label><br />
                        <input type="text" name ="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class ="input-text validate-email required-entry" />
                    </div>

pushed. Saving, evtl. Clear cache and then there is also the company name in the registry.

PictureIf one wants to, that the Company Name field is a required field, you can copy the necessary points of the email. Anschließend sieht es dann so aus

                    <div class ="input-box">
                        <label for="company"><?php echo $this->__('Company') ?> <span class="required">*</span></label><br />
                        <input type="text" name ="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class ="input-text required-entry" />
                    </div>

 

Addendum dated 21.10.2106

Ich habe gerade nochmal versucht dies für Magento 1.9 zu adaptieren. Das Feld bei der Registrierung anzeigen zu lassen ist soweit kein Problem. Die Datei register.phtml aus dem Verzeichnis app/design/frontend/base/default/template/persistent/customer/form wird in das eigene Template kopiert (important folder “persistent” NOT “customer”!) und dort an die gewünschte Stelle dies eingefügt

                <li>
                    <label for="company"><?php echo $this->__('Company') ?></label>
                    <div class ="input-box">
                        <input type="text" name ="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Company')) ?>" class ="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
                    </div>
                </li>

Anschließend wird das Feld in der Registrierung angezeigt und kann auch verwendet werden. Das Problem ist nun aber, dass es im Backend im Kundenkonto nicht angezeigt wird. Because of this website anyway project extension “Customer Attributes” was installed by Amasty, habe ich mich dann auch nicht länger damit aufgehalten und die Extension verwendet. Vielleicht findet ja jemand eine Lösung, um das Feld auch im Kundenkonto anzeigen zu lassen.

Used in Magento Version 1.4.1.1 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

4 comments on “Magento – Create account – Indicate company”

  1. Bei neueren Versionen scheint der Pfad anders zu sein, nämlich:
    /frontend/default/[THEME]/template/persistent/customer/form/register.phtml

    Dann jedenfalls klappt es bei mir :)!

Leave a Reply

Your email address will not be published. Required fields are marked *