Edit Customer Address Form's Name Fields
-
12-12-2019 - |
Question
I am editing the layout of my edit.phtml in template/customer/address/, i have edited the layout and labels of some fields there, no problem.
Except, i have 3 fields in the code which i can't edit because they are being called on the following way:
Begin of the code:
$this->getBlockHtml('formkey') in address magento
Later in the code:
<?php echo $this->getNameBlockHtml() ?>
I have no idea where to edit the layout/label names, etc. of this fields. All evening i tried to find out where to do, but searching other questions is leading me to .php files, but not, for example to the tag of the field.
How can i accomplish this?
Solution
$this->getBlockHtml('formkey')
creates a hidden field which you should not remove. (It is a security feature to help protect against cross-site scripting attacks.)
<?php echo $this->getNameBlockHtml() ?>
would logically take you to app\code\core\Mage\Customer\Block\Address\Edit.php
which is probably the PHP file you mentioned. The important thing to note there is the getNameBlockHtml()
method, which dynamically creates a new 'customer/widget_name'
block. As the name of the block suggests, the template for that block can be found in app\design\frontend\base\default\template\customer\widget\name.phtml