Magento – State/Province (“Region”) Required field shipping checkout! MAGENTO2
checkoutcustomermagento2
i want to checkout shipping adress, State/Province ("Region") be Required.
Best Answer
Go to Stores > Configuration > General and in State Options group mark all countries for which you wish to require State/Province in State is Required for field.
If the error message is Please enter the state/province. then this happens on the address validation. You can see this in the class Mage_Customer_Model_Address_Abstract::_basicCheck. It gets into this error when there is no region selected and the region is required for the country attached to the address.
if ($this->getCountryModel()->getRegionCollection()->getSize()
&& !Zend_Validate::is($this->getRegionId(), 'NotEmpty')
&& Mage::helper('directory')->isRegionRequired($this->getCountryId())
) {
$this->addError(Mage::helper('customer')->__('Please enter the state/province.'));
}
This would normally happen with one of two things.
A custom template has removed/modified the fields so they are not submitted when required,
The attributes are not set to be used against the correct forms,
Easiest way to test the first one is to reset to the default theme and see if the problem still occurs. If the problem does still occur then you can check the table customer_form_attribute to make sure the attributes are attached to the correct forms.
Best Answer
Go to
Stores > Configuration > General
and inState Options
group mark all countries for which you wish to require State/Province inState is Required for
field.