【问题标题】:Magento Adding Address Attributes To The CheckoutMagento 在结账时添加地址属性
【发布时间】:2013-07-13 10:54:43
【问题描述】:

我已经使用这个出色的网站构建了我自己的 Magento 模块,其中包含一个额外的客户地址字段; http://silksoftware.com/magento-module-creator

我创建了一个名为“mycarmake”的新客户地址属性。我可以在管理面板中查看、编辑和保存属性,没问题。

但是,我在将其添加到结帐时遇到了更多麻烦。我已将此字段添加到 app/design/default/TEMPLATE_NAME/persistent/checkout/onepage/billing.phtml 但它不会保存到客户地址记录中 - 有人可以告诉我为什么它不起作用吗?

<!-- add fields here -->
<li class="fields">
<div class="field">
<label for="billing:mycarmake"><?php echo $this->__('My Car Make') ?></label>
<div class="input-box">
<input type="text" id="billing[mycarmake]" name="billing[mycarmake]" value="<?php echo $this->htmlEscape($this->getAddress()->getMycarmake()) ?>" title="<?php echo $this->__('My Car Make') ?>" class="input-text" />
</div>
</div>
</li>
<!-- end add fields here -->

我也将它添加到我的模块的 etc/config.xml 中;

</resources>

<fieldsets>
        <sales_copy_order_billing_address>
            <mycarmake><to_order>*</to_order></mycarmake>
        </sales_copy_order_billing_address>
        <sales_copy_order_shipping_address>
            <mycarmake><to_order>*</to_order></mycarmake>
        </sales_copy_order_shipping_address>
        <sales_convert_quote_address>
            <mycarmake><to_order_address>*</to_order_address><to_customer_address>*</to_customer_address></mycarmake>
        </sales_convert_quote_address>
        <sales_convert_order_address>
            <mycarmake><to_quote_address>*</to_quote_address></mycarmake>
        </sales_convert_order_address>
        <customer_address>
            <mycarmake><to_quote_address>*</to_quote_address></mycarmake>
        </customer_address>
        <checkout_onepage_billing>
            <mycarmake><to_customer>*</to_customer></mycarmake>
        </checkout_onepage_billing>
    </fieldsets>

【问题讨论】:

  • 感谢此链接!我会像你一样尝试做同样的事情,我会告诉你一些事情(Omg 2013 :S)
  • 您还可以使用第三方扩展程序在结帐时添加自定义属性,这是一个 - fmeextensions.com/…

标签: magento magento-1.7


【解决方案1】:

管理 > 客户 > 属性 > 管理客户地址属性

查看您的 mycarmake 属性并确保 Show on Frontend 设置为 Yes

【讨论】:

  • 您好,感谢您的回复 - 我找不到客户属性的管理选项 - 那在哪里?
  • 这个功能我认为只有企业才有
猜你喜欢
  • 2014-10-29
  • 2015-06-22
  • 2011-08-02
  • 1970-01-01
  • 2012-01-13
  • 1970-01-01
  • 2021-08-10
  • 2021-09-13
  • 1970-01-01
相关资源
最近更新 更多