1

My company is using Sage Payment Solutions for credit card processing. They require a value for the state field for validation, even on international orders where the country has not states.

I am trying as a workaround to force a value into the state field. I have added value="XX" as a default in default/template/persistent/checkout/onepage/billing.phtml but it did not seem to help.

This seems like it should be a simple fix, but I've tried several things that aren't working.maybe I need to be looking at the javascript?

Any help would be appreciated. Even a direction to start looking in!

Thanks

willboudle
  • 274
  • 5
  • 18

3 Answers3

2

I just solve this problem to my Client:

To make the State/Province Required Field: http://www.magentocommerce.com/knowledge-base/entry/configuring-the-state-province-field-for-addresses/

Here is Add any custom State/Province(Region) to any Country: http://www.sycha.com/magento-add-custom-state-province-region-country

I'm here to help u

Mansour Alnasser
  • 4,446
  • 5
  • 40
  • 51
0

Edit the template file that you mentioned and add the following css class to your input field that you want to require:

class="input-text required-entry"

This will make sure that there is javascript validation and that the field needs to be filled in before the customer can proceed to the next checkout step.

PS: Nobody start about the fact that javascript validation only without server side validation is not good... You can't even add a product to your cart if javascript is disabled ;)

Kenny
  • 5,350
  • 7
  • 29
  • 43
  • I had thought about that, but customers from countries without states (most of them) are going to be confused as to what to enter. I would prefer to just send a useless value if left empty. Like making the state say XX, that's what we did for out other software, I just can't figure it our for magento. – willboudle Aug 29 '12 at 11:15
  • Ebizmarts helped me resolve it by passing a "-" to sage payments if the field is left empty. Excellent company with outstanding customer service! – willboudle Aug 30 '12 at 19:05
0

Besides the use of the class

class="input-text required-entry"

you also have to enable the "State is required for" and choose the country. This option is in

"System->Configuration->General->General->States Options"

mitramcc
  • 1
  • 2