我正在使用本教程在注册表格中添加Magento 1.9中的其他字段:http://www.fontis.com.au/blog/magento/know-more-about-your-customers-adding-custom-signup-attributes
但不幸的是它不起作用.我是Magento的新手,需要一些帮助.我将非常感谢如何创建新模块的分步说明,以便能够在当前注册表格Magento 1.9中添加此附加字段.
Jam*_* H. 16
好的,我刚刚做到了,这是怎么回事.访问http://www.silksoftware.com/magento-module-creator/并使用其Module Creator创建一个名为"YourCustomerAttribute"的新模块.
修改位于app/design/frontend/base/default/template/persistent/customer/form/register.phtml并添加:
<div class="input-box">
<label for="YourAttributeName"><?php echo $this->__('YourAttributeName') ?><span class="required">*</span></label><br />
<input type="text" name="YourAttributeName" id="YourAttributeID" value="<?php echo $this->htmlEscape($this->getFormData()->getYourAttributeName()) ?>" title="<?php echo $this->__('YourAttributeName') ?>" class="required-entry input-text" />
</div>
Run Code Online (Sandbox Code Playgroud)如果您希望客户能够修改客户面板中的属性,请修改app/design/frontend/base/default/template/customer/form/edit.phtm并添加:
<li>
<label for="YourAttributeName" class="required"><em>*</em><?php echo $this->__('YourAttributeName') ?></label>
<div class="input-box">
<input type="text" name="YourAttributeName" id="YourAttributeID" value="<?php echo $this->escapeHtml($this->getCustomer()->getYourAttributeName()) ?>" title="<?php echo $this->__('YourAttributeName') ?>" class="input-text required-entry" />
</div>
</li>
Run Code Online (Sandbox Code Playgroud)刷新所有缓存.
| 归档时间: |
|
| 查看次数: |
17016 次 |
| 最近记录: |