2

I created three new fields in the register address, I need to show them in the order details. I tried adding them going:

System > Customers > Settings > Templates Address

And added the fields with the same name that is in the database. Here's an example of how I tried:

{{number_address}}
{{depend number_address}}{{var number_address}}{{/depend}}
{{if number_address}}{{var number_address}},  {{/if}}
0

I've read this tutorial: http://www.magentocommerce.com/wiki/5_-_modules_and_development/how_to_add_custom_field_in_billing_and_shipping_address_in_frontend_and_backend

Check the attribute creation:

foreach ($attributes as $attributeCode => $data) {
    $attribute = $eavConfig->getAttribute('customer_address', $attributeCode);
    $attribute->setWebsite($store->getWebsite());
    $attribute->addData($data);
        $usedInForms = array(
            'adminhtml_customer_address',
            'customer_address_edit',
            'customer_register_address'
        );
        $attribute->setData('used_in_forms', $usedInForms);
    $attribute->save();
}

See the $usedInForms array ? Try to insert the handles of order details pages there.

It may not suffice, but I think it's necessary.

  • Thanks for reply Niloct. I used this... I found a bug now, when I go into the details of the purchase> Edit Billing Address or Edit Shipping Address appears those fields that I created, but empty. But when I go to Customers > Manage Customers > Choose an Customer > Addresses fields appear filled. – Eduardo Feb 25 '14 at 13:23
  • If I fill them by admin didn't work too. – Eduardo Feb 25 '14 at 18:01
  • I found my error, I haven't added the columns in the table sales_flat_order_address. Thanks to everyone. – Eduardo Feb 25 '14 at 19:53
  • Great insight =) You're welcome. – Niloct Feb 25 '14 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.