我从magento开始,我正在尝试修改一个模板。现在登记表有名字和姓氏,我希望它只有名字。我检查了代码,在文件"template/ppersistent/customer/form/register.phtml"中发现了一些内容,该文件包含表单的所有字段,但对于名字和姓氏,它有以下代码:
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
有没有我应该设置注册表项的文件?
提前谢谢。
您需要导航到template/customer/widget/name.phtml。如果主题中不存在此项,请将其从默认文件夹复制到相同的文件夹结构中。
您将找到一个带有标签和输入的<div class="field name-lastname">
,您可以对其进行注释。
您可以将div设置为style="display:none;"
并将"姓氏"输入框的值更改为类似"_"的值