But strangely, I can’t set up the telephone to “not mandatory” or “not visible” without beeing prompt by javascript when placing an order.
Do you have any suggestion on this issue?
Hi All
In order to remove the State/Province field, you just need to replace the required field from:
checkout/onepage/shipping.phtml
checkout/onepage/billing.phtml
If you want to remove validation of province/state, jus TRUNCATE this table: ‘directory_country_region’
this will kill province validation forever. if you just want to get rid of ‘mandatory’-validation and still want to use validation features elsewhere (e.g. with a customized newsletter tool) you can better use phpmyadmin, open table eav_attribute and set the column is_required to 0 where attribute_code is ‘region’.
after that, just remove the class ‘required-entry’ from the region input in the form’s tpl.file to get rid of javascript validation (or just delete the whole shebang) - there you go with optional/no regions.
I don’t recommend any other better solution than this.
Cheers
Last but not least, after you have installed this extension and get rid of the unwanted customer address fields then kindly give them a good review !!!
Hi, I’m under 1.5.1 CE and none of the extensions I’ve found (or read about) work for the State / Province field in the backend. Same thing for code modifications.
So I was looking for a solution for hours in the code and finaly came up with something (actually the difficult part was only to find the right file to modify). As I didn’t find anything for this field to be not required in the backend but still optionnal, I share what I found that worked for me :
Create a new file : app\code\local\Mage\Adminhtml\Block\Customer\Edit\Renderer\Region.php
which is a copy / paste of : app\code\core\Mage\Adminhtml\Block\Customer\Edit\Renderer\Region.php
Modify the first one (the one you created) on line 58, replace
class="select required-entry''
by
class="select"
.
Otherwise, if you want the combo-box to be always empty, and then to be in fact an input text (still not required) :
Create a new file : app\code\local\Mage\Adminhtml\Block\Sales\Order\Create\Form\Abstract.php
which is a copy / paste of : app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Form\Abstract.php
Hi,
If you want to remove state/province field from all address forms, try this.
Copy this file: app/code/core/Mage/Adminhtml/CustomerEdit/Renderer/Region.php
To: app/code/local/Mage/Adminhtml/CustomerEdit/Renderer/Region.php
And edit the new file.
works on 1.5.1 CE
public function render(Varien_Data_Form_Element_Abstract $element) { return $element->getDefaultHtml(); }
this function is implemented in v1.7 CE
go to ‘Configuration->General->States Options’ and choose options.
This new feature create a conflict with DULL extension :
When create a new account, if you select same addresse for shipping, the next step (3) is validated but stay on step 2 instead of going to step 4
(work if you select ‘different address for shipping’)