I have a D7 + Commerce site. One of the products is a free sample. The billing panes are hidden when they checkout and only have a free sample in their cart. I also have a rule detecting when it is only a free sample in their cart, and offering a free shipping option. How can I add validation to that shipping address so that they have to put something in. Right now they can check out without entering a shipping address, since Country is the only required field and it has a default value.

I am trying to add a condition in the flat rate shipping option of "Order address component comparison" (see: http://i.imgur.com/BYZxQ4h.png) and I want to add a wildcard or a greater than option to that comparison, but I am not sure how to do that. (See: http://i.imgur.com/VG8rP4u.png)

Alternatively is there and overall way to make certain address fields required?

Comments

iwant2fly’s picture

I am still searching for an answer on this. Is the thought process that the shipping address would always be validated through other modules by using the info in it? It just seems strange to me that the address entry itself does not have some validation controlls.

Jurgen8en’s picture

Do you already have a solution for this?
"validation control for order fields, like address"

WorldFallz’s picture

I'm not sure I understand the issue. One of the great things about commerce is that is uses standard drupal techniques and modules. Fields can be made required right in their settings. And if more validation than is available via the field's settings is necessary, there's the field_validation module as well as creating a custom validation handler with code.

_
Care about the future of the Drupal.org forums? Please join our conversation and show support for improving the forums infrastructure.