Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Magento移动电话字段以创建新帐户页面_Php_Magento_Magento 1.7 - Fatal编程技术网

Php Magento移动电话字段以创建新帐户页面

Php Magento移动电话字段以创建新帐户页面,php,magento,magento-1.7,Php,Magento,Magento 1.7,在“创建新客户帐户”页面部分,是否有简单的方法移动现有电话字段 我知道新地址部分中存在电话字段,我不想创建新的客户属性 到目前为止,我已经尝试了中提供的答案,但没有帮助 我有Magnetor版本1.7.0.2,非常感谢您的帮助。//打开以下文件 app\design\frontend\base\default\template\persistent\customer\form\register.phtml 注释以下if条件或将电话文件写在if条件外 <?php if($this->

在“创建新客户帐户”页面部分,是否有简单的方法移动现有电话字段

我知道新地址部分中存在电话字段,我不想创建新的客户属性

到目前为止,我已经尝试了中提供的答案,但没有帮助

我有Magnetor版本1.7.0.2,非常感谢您的帮助。

//打开以下文件

app\design\frontend\base\default\template\persistent\customer\form\register.phtml
注释以下if条件或将电话文件写在if条件外

<?php if($this->getShowAddressFields()): ?>
<?php if($this->getShowAddressFields()): ?> 

更多参考链接:

例如:

//在if条件的一侧写出下面的代码,然后重试

 <div class="field">
                    <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
                    <div class="input-box">
                        <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />
                    </div>
                </div>

*

您必须按照以下步骤在注册表中填写电话字段

步骤1您必须在自定义模块布局文件中放置以下代码

<customer_account_create translate="label">
    <label>Customer Account Registration Form</label>
    <remove name="right"/>
    <remove name="left"/>

    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="customer/form_register" name="customer_form_register" template="modulename/register.phtml">
            <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                <label>Form Fields Before</label>
            </block>
        </block>
    </reference>
</customer_account_create>

客户帐户登记表
第/1页column.phtml
之前的表单字段
步骤2在以下路径中创建register.phtml文件app/design/frontend/theme\u name/default/template/modulename/register.phtml

步骤3复制以下路径中的register.phtml文件app\design\frontend\base\default\template\persistent\customer\form\register.phtml

步骤4将register.phtml文件放在本地模块路径app/design/frontend/theme\u name/default/template/modulename/

步骤5检查以下编码并在if条件中设置为真,否则删除if条件

<?php if($this->getShowAddressFields()): ?>
<?php if($this->getShowAddressFields()): ?> 


步骤6您可以在注册表中看到带有地址字段的电话字段。

上面提到的这一行出现在两个地方,您可以发布代码片段替换什么吗,因为我已经尝试了链接中提到的解决方案,它对我不起作用。谢谢,这很有帮助,现在我可以在新帐户创建页面上看到一个电话文本框,但是我看不到信息存储在管理页面的任何地方,管理页面中的电话字段仍然是空的,但是我也没有收到任何错误。如何将其存储在数据库中需要在控制器中调试。检查此操作(createPostAction)中的post参数,文件路径为:app/code/core/Mage/Customer/controllers/AccountController.php。您将在post数据中找到电话参数。不要更改文件名。感谢Jitendra,我没有更改字段名,步骤已完成:将电话字段移到If条件之外,我可以看到“创建帐户”页面“电话-文本框”上显示的文本字段具有所需的值,但数据不会保存在任何位置,我想这可能是因为它是账单地址表的一部分,我在所有与客户相关的表中进行了验证,它没有保存在任何地方。