Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Change Address Form For Create and Edit Order
 
firewire7
Jr. Member
 
Total Posts:  7
Joined:  2009-08-18
 

Does anyone know how this form is created:

app/design/adminhtml/default/default/template/sales/order/create/form/address.phtml

It is the forms for the billing address and shipping address on the create and edit order page.

This line of code creates the forms:

<?php echo $this->getForm()->toHtml() ?>

But it has to pull html from somewhere doesn’t it?

I would like to change the drop down for the country to a text box and I would like to know where the html is stored.

I am aware of the loss of functionality, but it makes sense for my use.

 
Magento Community Magento Community
Magento Community
Magento Community
 
robertbanh
Jr. Member
 
Total Posts:  20
Joined:  2009-03-31
 

\app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Form\Address.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
Saggy
Sr. Member
 
Total Posts:  133
Joined:  2009-02-03
 

It is in template/checkout/onepage/billing.phtml for billing and template/checkout/onepage/billing.phtml for shipping

 
Magento Community Magento Community
Magento Community
Magento Community
 
firewire7
Jr. Member
 
Total Posts:  7
Joined:  2009-08-18
 

I checked out this file:

\app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Form\Address.php

It seems to be what I was looking for, however, I can’t seem to figure out how to change the country box from a drop down to a text box. This was easy to do with the files that generated the form out of html. But it seems this file is creating the form out of PHP.

It seems the file calls for getInputType()), but I am not sure if this is the right variable or where to edit the variable?

It also has this line
$this->getLayout()->createBlock(’adminhtml/customer_edit_renderer_country’)

that changes the Region to an input-text with this code:

$element->setClass(’input-text’);

But how can I do this for the country?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Saggy
Sr. Member
 
Total Posts:  133
Joined:  2009-02-03
 

In these two files you can remove the country drop down and put input box instead. The only thing you need to make sure that both input boxes have <b>billing.</b> and </b>shipping.</b> as prefix in there name. You can refer other input boxes in these pages.

Cheers
S

 
Magento Community Magento Community
Magento Community
Magento Community
 
firewire7
Jr. Member
 
Total Posts:  7
Joined:  2009-08-18
 

@saggy I appreciate your help. I have already edited those files for the onepage checkout on the frontend. But I am trying to fix the adminhtml section. Specifically on this url /index.php/admin/sales_order_edit/. I am trying to get rid of the dropdown for the country on that page. Do you have any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Saggy
Sr. Member
 
Total Posts:  133
Joined:  2009-02-03
 
firewire7 - 16 September 2009 07:12 AM

@saggy I appreciate your help. I have already edited those files for the onepage checkout on the frontend. But I am trying to fix the adminhtml section. Specifically on this url /index.php/admin/sales_order_edit/. I am trying to get rid of the dropdown for the country on that page. Do you have any ideas?

Hi Firewire,

Sorry should have read the post before. The form is getting generated from eav_attribute table based on the frontend_input field.

If you run the following query in SQL and change the frontend_input from select to text then you will be able to see textbox.

select from eav_attribute where attribute_code like 'count%'

Note -: It doesn’t store the country name itself. It stores the country_id in the database so it wouldn’t be sensible to change this from dropdown to input unless you have special requirement and you have to do it.

Hope this will help.

Cheers
S

 
Magento Community Magento Community
Magento Community
Magento Community
 
firewire7
Jr. Member
 
Total Posts:  7
Joined:  2009-08-18
 

Saggy,

Thank you so much. I cannot even express how much that helped me. I wasted hours looking for this. I should have figured it was stored in the database.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Saggy
Sr. Member
 
Total Posts:  133
Joined:  2009-02-03
 

Glad I could help!!!!!

Cheers
S

 
Magento Community Magento Community
Magento Community
Magento Community
 
Fabio Casolari
Jr. Member
 
Total Posts:  8
Joined:  2009-11-13
 

How i can modify the form??  adding my custom filed?

Sales -> Order -> New Order -> New Client

 
Magento Community Magento Community
Magento Community
Magento Community
 
magento123
Member
 
Avatar
Total Posts:  64
Joined:  2010-12-30
 

Hi, all

Can i get cities drop down list in admin panel?

Actually when i am trying to add a new order , it requires a new customer

If i add a new customer i get the field as cities in the form of text area

But i wanted it to be in drop down

how can i get it in the admin panel in the backend??

Thanks smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
magento123
Member
 
Avatar
Total Posts:  64
Joined:  2010-12-30
 

What version were you using firewire7?

I am stuck with something same but i can’t find those lines you wrote…

Thanks in advance

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top